From ee8b621dc47ac5c9400f23ee51e401558bf6a385 Mon Sep 17 00:00:00 2001 From: Peter O Date: Sat, 24 Aug 2019 09:21:30 -0400 Subject: [PATCH] version 4.0.0-beta2 --- CBOR.nuspec | 45 ++++++++++--------------------- CBOR/PeterO/Cbor/CBORReader.cs | 3 +++ CBOR/PeterO/Cbor/PropertyMap.cs | 2 +- CBOR20/Properties/AssemblyInfo.cs | 5 ++-- CBOR40/Properties/AssemblyInfo.cs | 5 ++-- Properties/AssemblyInfo.cs | 7 +++-- 6 files changed, 25 insertions(+), 42 deletions(-) diff --git a/CBOR.nuspec b/CBOR.nuspec index 1552b2dc..c2af9fd7 100644 --- a/CBOR.nuspec +++ b/CBOR.nuspec @@ -1,32 +1,15 @@ 4.0.0-beta1PeterO.CborfalseVersion 4.0.0-beta1: - -- Support nullable types in CBORObject.ToObject. -- Update Numbers library to newer version -- JSONOptions.Base64Padding now has no effect. The library will now write padding as necessary when - writing traditional base64 to JSON and write no padding when writing base64url to JSON. -- JSONOptions.ReplaceSurrogates property added. -- Restrict valid shared reference indices to integers 0 or greater. -- Reject writing JSON where CBOR maps have two keys with the same string equivalent. -- Improve performance of CBOR object comparisons involving big floats. - -Version 4.0.0-alpha2: - -- Support CBOR tags for IRIs and IRI references. -- Add CBOREncodeOptions.DefaultCtap2Canonical field. - -Version 4.0.0-alpha1: - -- Remove all APIs obsoleted since version 3.4. This - includes the BigInteger, ExtendedDecimal, and ExtendedFloat APIs, - which were renamed and moved to a different library, as well as the - ICBORTag and CBORTypeFilter APIs. -- Changed implementation of FromObject, including imposing a nesting depth - limit and supporting a CBORTypeMapper parameter. -- Property name conversion rules (in PODOptions) were changed - in this version with respect to FromObject. In this sense, - PODOptions.RemoveIsPrefix was removed. -- Certain other changes in CBOR object reading and validation were - made; they are largely compatible with previous versions but may be - backwards-incompatible in certain rare casesCC0-1.0https://github.com/peteroupc/CBORPeter OccilA C# implementation of Concise Binary Object Representation (CBOR), a general-purpose binary data format defined in RFC 7049.Peter OccilCBOR (Concise Binary Object Representation)cbor data serialization binary json +>4.0.0-beta2PeterO.CborfalseVersion 4.0.0-beta2: + +The features in this version include: + +- The CBOR library no longer stores numbers in a special form beyond the CBOR data model, which represents all "65-bit" signed integers and all "double" values. This means the CBOR library no longer stores certain numbers as EDecimal, EInteger, EFloat, etc., rather than as tagged CBOR objects. +- CBORObject.CompareTo now compares objects using the default deterministic encoding comparison in the draft revision of the CBOR specification, and no longer treats numbers (objects with the former type CBORType.Number) as a special class. +- CBORType.Number is deprecated; CBORObjects no longer have this type. In its place, certain numbers now have new CBORTypes Integer or FloatingPoint. +- CBORObject now stores floating-point numbers internally as the bits that make them up, rather than as `double`s, to avoid data loss in conversions. +- Methods were added to CBORObject to read and write floating-point numbers in terms of their bit patterns rather than as `double`s or `float`s. +- Ctap2Canonical was made more strict and now works when decoding CBOR objects. +- Added ReadSequence and DecodeSequence to CBORObject for reading CBOR sequences. +- New CBORNumber class for storing numbers representable in CBOR. The new CBORObject.IsNumber property checks whether a CBOR object represents a number. +- Bug fixesCC0-1.0https://github.com/peteroupc/CBORPeter OccilA C# implementation of Concise Binary Object Representation (CBOR), a general-purpose binary data format defined in RFC 7049.Peter OccilCBOR (Concise Binary Object Representation)cbor data serialization binary json \ No newline at end of file diff --git a/CBOR/PeterO/Cbor/CBORReader.cs b/CBOR/PeterO/Cbor/CBORReader.cs index 260f3709..955ed8fc 100644 --- a/CBOR/PeterO/Cbor/CBORReader.cs +++ b/CBOR/PeterO/Cbor/CBORReader.cs @@ -496,6 +496,9 @@ private static byte[] ReadByteData( Stream stream, long uadditional, Stream outputStream) { + if (uadditional == 0) { + return new byte[0]; + } if ((uadditional >> 63) != 0 || uadditional > Int32.MaxValue) { throw new CBORException("Length" + ToUnsignedEInteger(uadditional) + " is bigger than supported "); diff --git a/CBOR/PeterO/Cbor/PropertyMap.cs b/CBOR/PeterO/Cbor/PropertyMap.cs index be76f459..dc858152 100644 --- a/CBOR/PeterO/Cbor/PropertyMap.cs +++ b/CBOR/PeterO/Cbor/PropertyMap.cs @@ -833,7 +833,7 @@ public static CBORObject CallToObject( public static object CallFromObject( CBORTypeMapper.ConverterInfo convinfo, CBORObject obj) { - return (CBORObject)PropertyMap.InvokeOneArgumentMethod( + return (object)PropertyMap.InvokeOneArgumentMethod( convinfo.FromObject, convinfo.Converter, obj); diff --git a/CBOR20/Properties/AssemblyInfo.cs b/CBOR20/Properties/AssemblyInfo.cs index e1cac683..cb4e83c9 100644 --- a/CBOR20/Properties/AssemblyInfo.cs +++ b/CBOR20/Properties/AssemblyInfo.cs @@ -1,6 +1,6 @@ using System.Reflection; [assembly: System.CLSCompliant(true)] -[assembly: AssemblyInformationalVersion("4.0.0-beta1")] +[assembly: AssemblyInformationalVersion("4.0.0-beta2")] [assembly: AssemblyVersion("4.0.0")] [assembly: AssemblyFileVersion("4.0.0.0")] [assembly: AssemblyProduct("CBOR (Concise Binary Object Representati" + @@ -12,5 +12,4 @@ "rpose binary data format defined in RFC " + "7049.")] [assembly: AssemblyCompany("Peter Occil")] -[assembly: AssemblyCopyright("http://creativecommons.org/publicdomain/" + -"zero/1.0/")] +[assembly: AssemblyCopyright("CC0-1.0")] diff --git a/CBOR40/Properties/AssemblyInfo.cs b/CBOR40/Properties/AssemblyInfo.cs index e1cac683..cb4e83c9 100644 --- a/CBOR40/Properties/AssemblyInfo.cs +++ b/CBOR40/Properties/AssemblyInfo.cs @@ -1,6 +1,6 @@ using System.Reflection; [assembly: System.CLSCompliant(true)] -[assembly: AssemblyInformationalVersion("4.0.0-beta1")] +[assembly: AssemblyInformationalVersion("4.0.0-beta2")] [assembly: AssemblyVersion("4.0.0")] [assembly: AssemblyFileVersion("4.0.0.0")] [assembly: AssemblyProduct("CBOR (Concise Binary Object Representati" + @@ -12,5 +12,4 @@ "rpose binary data format defined in RFC " + "7049.")] [assembly: AssemblyCompany("Peter Occil")] -[assembly: AssemblyCopyright("http://creativecommons.org/publicdomain/" + -"zero/1.0/")] +[assembly: AssemblyCopyright("CC0-1.0")] diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs index 4179268a..cb4e83c9 100644 --- a/Properties/AssemblyInfo.cs +++ b/Properties/AssemblyInfo.cs @@ -1,7 +1,7 @@ using System.Reflection; [assembly: System.CLSCompliant(true)] -[assembly: AssemblyInformationalVersion("4.0.0-beta1")] -[assembly: AssemblyVersion("4.0.0-beta2")] +[assembly: AssemblyInformationalVersion("4.0.0-beta2")] +[assembly: AssemblyVersion("4.0.0")] [assembly: AssemblyFileVersion("4.0.0.0")] [assembly: AssemblyProduct("CBOR (Concise Binary Object Representati" + "on)")] @@ -12,5 +12,4 @@ "rpose binary data format defined in RFC " + "7049.")] [assembly: AssemblyCompany("Peter Occil")] -[assembly: AssemblyCopyright("http://creativecommons.org/publicdomain/" + -"zero/1.0/")] +[assembly: AssemblyCopyright("CC0-1.0")]