Comments (2)
As discussed, maybe a v1.4 before 2.0 can have this baby step before merging in CBOR tags.
- deprecate but still support boolean encoding modes in v1.4
- add SortMode (int) and ShortestFloat (int) as encoding options to replace encoding mode booleans.
The combination of SortMode and ShortestFloat can be used to specify these modes in v1:
- default
- Canonical
- CTAP2
- Core Deterministic Encoding Rule 2 (7049bis)
- and modes that don't have a name yet
type SortMode int
const (
SortNone SortMode = 0 // no sorting
SortLengthFirst SortMode = 1 // Old Canonical
SortBytewiseLexical SortMode = 2 // Bytewise Lexicographic
SortCanonical SortMode = SortLengthFirst
SortCTAP2 SortMode = SortBytewiseLex
SortCoreDeterministic SortMode = SortBytewiseLex
)
type ShortestFloat int
const (
ShortestFloatNone ShortestFloat = 0 // no change
ShortestFloat16 ShortestFloat = 1 // float16 as shortest form of float that preserves value
ShortestFloat32 ShortestFloat = 2 // float32 as shortest form of float that preserves value
ShortestFloat64 ShortestFloat = 3 // float64 as shortest form of float (this may convert from float32 to float64, etc.)
)
from cbor.
@fxamacker hey, I think this can be closed because of your commits today. nice work!
from cbor.
Related Issues (20)
- bug: Marshal can produce malformed CBOR when marshaling a cbor.Marshaler that produces malformed CBOR HOT 1
- Use cases of UnmarshalFirst? HOT 2
- Wrap error returned from MarshalCBOR in MarshalerError HOT 3
- bug: Two different keys that decode into the same field are not considered duplicate keys when decoding into struct HOT 3
- feature: Add TimeTagToAny option to produce RFC3339 when decoding time into interface{} HOT 4
- feature: Allow decoding a byte string into time.Time value HOT 8
- feature: add build tag for tinygo to move tinygo into main branch HOT 1
- question: how to correctly decode CBOR-encoded data that was encoded with `cbor.StringToByteString` HOT 3
- Bug: decoding CBOR byte string into `time.Time` is allowed if decoding option `DefaultByteStringType` is set to `reflect.TypeOf("")` HOT 3
- How to convert CBOR to JSON HOT 3
- feature: Add new interface as alternative to existing `Marshaler` interface HOT 1
- feature: add support for handling CBOR enumerated alternative data items HOT 7
- feature: Options to reject floating-point NaN and Inf values on encode and decode HOT 2
- feature: Add a new SortMode to encode struct fields in a less predictable order HOT 3
- feature: Let users provide their own buffer to encode into HOT 2
- feature: Option to disable built-in support for BinaryMarshaler and BinaryUnmarshaler HOT 2
- feature: Options to disable bignum support HOT 1
- feature: Option to Ignore JSON Tags While Encoding and Decoding HOT 2
- Using `ByteSliceMode` (unreleased new feature) can encode invalid CBOR data HOT 3
- Replace *errors.errorString with more specific error type for "inadmissible type for tag content"
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cbor.