Update README.md:
- Update "Status" section.
- Replace "struct tags" with "struct tag options" when referring to options.
Update doc.go:
- Mention omitzero option (for struct tags) in more places. Also mention Diagnose, DiagnoseFirst, UnmarshalFirst, etc. added in prior releases.
- Add example using UnmarshalFirst to show support for trailing bytes (extraneous data) typically found in CBOR Sequences (RFC 8742).
- Add example using DiagnoseFirst to show support for representing binary CBOR data item in Extended Diagnostic Notation (human-readable text inspired by JSON).
- Replace "struct tags" with "struct tag options" when referring to options.
Update example_test.go
- Replace "struct tags" with "struct tag options" when referring to options.
* Add CBOR tags example, "Encoding and Decoding CWT (CBOR Web Token) with CBOR Tags".
* v2.1 passed 361+ million execs in coverage-guided fuzzing on Feb 17, 2020.
* Package cbor is a fast & safe CBOR encoder & decoder (RFC 7049) with a
standard API + toarray & keyasint struct tags, CBOR tags, float64->32->16,
CTAP2 & Canonical CBOR, duplicate map key options, and is customizable via
simple API.
Implement v2.0 API for easier CBOR encoding/decoding. See issue #117 for summary.
Replaced EncOptions.TimeRFC3339 bool with TimeMode values:
* TimeUnix // secs, converted to smallest CBOR integer that fits
* TimeUnixMicro // μs, CBOR float with subsecs in fractional part
* TimeUnixDynamic // secs or μs, either int or float depending on empty subsecs
* TimeRFC3339 // secs, string
* TimeRFC3339Nano // ns, string with trailing zeros removed
Decode CBOR time NaN and Infinity values to Go's "zero time" value.
This is how CBOR Null values are decoded to time.Time.
Removed deprecated options (Canonical & CTAP2Canoical) in EncOptions.
Removed Valid() function.
Improved performance and memory alloc by
* using pointer receivers for types implementing sort.Interface and others.
* storing pointer in sync.Pool.
* storing pointer as map value in sync.Map.
Used roughly 20 linters and resolved many reported issues.
Switched to GitHub Actions for CI to lint, test, and check code coverage.
Extensive improvements to README.md.
Thanks @x448 for API design ideas, travis & github ci configs, filing issues,
and improving README.md.
Closes: #107Closes: #119Closes: #120Closes: #123Closes: #124Closes: #127
EncOptions.Canonical is deprecated.
Use `cbor.EncOptions{Sort: cbor.SortCanonical}`.
EncOptions.CTAP2Canonical is deprecated.
Use `cbor.EncOptions{Sort: cbor.SortCTAP2}`.
This commit addresses part of issue #74.
This change allows decoding CBOR int to Go float.
Sometimes both integers or floating-point numbers can be used to
represent numbers in CBOR data, such as SenML (RFC 8428). Examples
use floating point for JSON and XML, while using int for CBOR.
Closes: #41