Skip to content

Commit 06cc88b

Browse files
authored
Merge pull request #61 from darobin/feat/ban-NaN-et-al
Address titular issues in #59 and #60
2 parents fc0a153 + c775b4e commit 06cc88b

File tree

2 files changed

+28
-1
lines changed

2 files changed

+28
-1
lines changed

bibliography.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"manifest": "M. Cáceres, K. Rohde Christiansen, D. González, D. Murphy, C. Liebel. <a href=\"https://www.w3.org/TR/appmanifest/\"><cite>Web Application Manifest</cite></a>. March 2025. URL:&nbsp;<a href=\"https://www.w3.org/TR/appmanifest/\">https://www.w3.org/TR/appmanifest/</a>",
1515
"rfc2119": "S. Bradner. <a href=\"https://www.rfc-editor.org/rfc/rfc2119\"><cite>Key words for use in RFCs to Indicate Requirement Levels</cite></a>. March 1997. URL:&nbsp;<a href=\"https://www.rfc-editor.org/rfc/rfc2119\">https://www.rfc-editor.org/rfc/rfc2119</a>",
1616
"rfc4648": "S. Josefsson. <a href=\"https://www.rfc-editor.org/rfc/rfc4648\"><cite>The Base16, Base32, and Base64 Data Encodings</cite></a>. October 2006. URL:&nbsp;<a href=\"https://www.rfc-editor.org/rfc/rfc4648\">https://www.rfc-editor.org/rfc/rfc4648</a>",
17+
"rfc8742": "C. Bormann. <a href=\"https://www.rfc-editor.org/rfc/rfc8742\"><cite>Concise Binary Object Representation (CBOR) Sequences</cite></a>. February 2020. URL:&nbsp;<a href=\"https://www.rfc-editor.org/rfc/rfc8742\">https://www.rfc-editor.org/rfc/rfc8742</a>",
1718
"rfc8949": "C. Bormann, P. Hoffman. <a href=\"https://www.rfc-editor.org/rfc/rfc8949\"><cite>Concise Binary Object Representation (CBOR)</cite></a>. December 2020. URL:&nbsp;<a href=\"https://www.rfc-editor.org/rfc/rfc8949\">https://www.rfc-editor.org/rfc/rfc8949</a>",
1819
"sha256": "National Institute of Standards and Technology, <cite>Secure Hash Algorithm. NIST FIPS 180-2</cite>. August 2002.",
1920
"url": "WHATWG. <a href=\"https://url.spec.whatwg.org/\"><cite>URL</cite></a>. Living Standard. URL:&nbsp;<a href=\"https://url.spec.whatwg.org/\">https://url.spec.whatwg.org/</a>",

drisl.src.html

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ <h2>Introduction</h2>
3131
<section>
3232
<h2>Format</h2>
3333
<p>
34-
DRISL is an application profile of CBOR ([[cbor]]) that subsets the more established [[cborc]] profile, with the following additional
34+
DRISL is an application profile of CBOR ([[cbor]]) that mostly subsets the more established [[cborc]] profile, with the following additional
3535
constraints:
3636
</p>
3737
<ul>
@@ -51,6 +51,32 @@ <h2>Format</h2>
5151
Floating-point numbers MUST always be encoded as a 64-bit IEEE 754 binary floating-point, never as a "half-precision" (16-byte, major 7-25) or "single-precision (32-byte, major 7-26)" CBOR key.
5252
<strong>NOTE</strong>: It is RECOMMENDED that users avoid encoding floating-point numbers as much as possible
5353
to minimize interoperability and tooling issues.
54+
<ul>
55+
<li>
56+
Completely avoiding floating-point numbers is RECOMMENDED to minimize interoperability and tooling issues.
57+
</li>
58+
<li>
59+
Even where floating-point numbers are used, most of the IEEE 754 "special" floating points (infinity, negative infinity, minimal NaN, and NaN with payloads) MUST NOT be encoded.
60+
Negative zero is the only allowed special floating point.
61+
</li>
62+
</ul>
63+
</li>
64+
<li>
65+
Indefinite-length arrays (and the "break" code making them usable, in major type 7) are not allowed.
66+
</li>
67+
<li>
68+
Similarly, indefinite, incomplete, or streaming CBOR cannot be hashed and thus cannot be referenced by CID; for this reason, DRISL can only encode finite, bounded documents and resources.
69+
</li>
70+
<li>
71+
Concatenation of DRISL objects is generally discouraged and incurs both performance and interoperability risks.
72+
<ul>
73+
<li>
74+
Note that DRISL objects cannot be streamed as CBOR streams (defined in RFC 8742) except in MIME-type aware contexts, as per the CBOR streams specification.
75+
</li>
76+
<li>
77+
Applications are discouraged from handling concatenated DRISL objects or appending extra bytes of any kind to a DRISL object in memory or across interfaces, as doing so breaks the DRISL-wide assumption that each CID refers to one complete, discrete, and valid CBOR object, and that DRISL systems only ever will be expected to handle such objects.
78+
</li>
79+
</ul>
5480
</li>
5581
<li>
5682
Encoders MUST NOT encode any simple values other than <code>true</code>, <code>false</code>, and <code>null</code> (20, 21, and 22 in section 3.3 of [[rfc8949]]).

0 commit comments

Comments
 (0)