-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add 2 options for decoding CBOR integers to any
Added 2 new decoding options to IntDecMode which specifies how to decode CBOR integers (major type 0 and 1) to Go interface{}. - IntDecConvertSignedOrError makes CBOR integers decode to: * int64 if value fits * return UnmarshalTypeError if value doesn't fit into int64 - IntDecConvertSignedOrBigInt makes CBOR integers decode: * int64 if value fits * big.Int or *big.Int if value doesn't fit into int64 Including default setting (IntDecConvertNone), there are now 4 options for decoding CBOR unsigned or CBOR negative integers into interface{}. Deprecated IntDecConvertSigned option in favor of other options for more consistent handling of values that don't git into int64. Also updated comments for existing IntDecMode options.
- Loading branch information
Showing
2 changed files
with
235 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters