fxamacker / cbor

CBOR codec (RFC 8949) with CBOR tags, Go struct tags (toarray, keyasint, omitempty), float64/32/16, big.Int, and fuzz tested billions of execs.
MIT License
748 stars 61 forks source link

Rename ByteSliceMode to ByteSliceLaterFormatMode, etc #554

Closed fxamacker closed 5 months ago

fxamacker commented 5 months ago

This PR renamed ByteSliceMode to ByteSliceLaterFormatMode and also renamed related options.

For context:

// ByteSliceLaterFormatMode specifies which later format conversion hint (CBOR tag 21-23)
// to include (if any) when encoding Go byte slice to CBOR byte string. The encoder will
// always encode unmodified bytes from the byte slice and just wrap it within
// CBOR tag 21, 22, or 23 if specified.
// See "Expected Later Encoding for CBOR-to-JSON Converters" in RFC 8949 Section 3.4.5.2.

Also considered using ByteSliceLaterEncodingMode but the word "format" (i.e. encoding format) is probably less ambiguous for people unfamiliar with RFC 8949 Section 3.4.5.2.

fxamacker commented 5 months ago

@benluddy @x448 PTAL 🙏