shamblett / cbor

A CBOR implementation for Dart
MIT License
36 stars 15 forks source link

(issue28) Fixes NaN being encoded in an unexpected format #30

Closed nicbn closed 2 years ago

nicbn commented 2 years ago

As of ieee754 1.0.3, NaN is now encoded with one filled mantissa, which is in-spec but made a test fail.

According to the RFC for CBOR the canonical format for NaN should be 0xf97e00, which was the previous result. The encoder is not following canonical format - it will produce indefinite length lists and maps if it is more efficient -, but a value must be chosen to make the encoder consistent, so this is now being used.