Try it
Text in, canonical CBOR out, canonical text back. The round-trip is the claim; the playground is the demonstration that a reader can operate themselves.
What runs here is implementations/js, one of the 11 independent implementations, unmodified. It was written from the specification alone by an author who could not see the reference — so if it and the bytes below disagree, that disagreement is the interesting thing on this page.
Canonical CBOR
a2 64 75 73 65 73 a1 6f 61 63 6d 65 2f 72 6f 75 74 65 2d 68 69 6e 74 da 00 01 11 d8 82 66 73 68 61 32 35 36 44 9f 2a 3c 7d 6b 74 72 61 6e 73 61 63 74 69 6f 6e da 00 01 11 d5 82 81 da 00 01 11 d6 69 6f 72 64 2d 38 38 32 31 33 a6 64 74 61 67 73 83 da 00 01 11 d4 66 75 72 67 65 6e 74 da 00 01 11 d4 64 67 69 66 74 da 00 01 11 d6 67 70 72 6f 6d 6f 2d 78 66 61 6d 6f 75 6e 74 da 00 01 11 d5 82 81 da 00 01 11 d4 63 75 73 64 c4 82 21 19 3a 97 66 64 69 67 65 73 74 da 00 01 11 d8 82 66 73 68 61 32 35 36 46 de ad be ef ca fe 67 72 65 63 65 69 70 74 48 89 50 4e 47 0d 0a 1a 0a 67 72 6f 75 74 69 6e 67 da 00 01 11 d9 82 6f 61 63 6d 65 2f 72 6f 75 74 65 2d 68 69 6e 74 a2 64 70 72 69 6f da 00 01 11 d4 64 68 69 67 68 64 7a 6f 6e 65 04 68 63 75 73 74 6f 6d 65 72 da 00 01 11 d5 82 81 da 00 01 11 d4 68 65 78 74 65 72 6e 61 6c da 00 01 11 d7 69 63 75 73 74 2d 34 34 37 31
Opens a file from your own machine. It is read in your browser and never sent anywhere — this site is static files with no server behind them.
Encoded when this page was built, by the reference implementation. Edit the document to re-encode it here, in your browser, with the JavaScript one.
Canonical text back
%unimsg 0 txn/v1 uses { acme/route-hint #sha256:9f2a3c7d } transaction @ord-88213 { customer external -> @cust-4471 amount usd 149.99 receipt ~hex:89504e470d0a1a0a digest #sha256:deadbeefcafe routing !acme/route-hint { zone 4, prio :high } tags [ :urgent, :gift, @promo-x ] }
Round trip
The claim is that these two forms are one object. Re-encoding the canonical text must give the same bytes. With scripting on, this pane says whether it did.
Open questions, including this page's
| question | leaning |
|---|---|
| does the playground ship the JS implementation or a WASM build of the Go one | JS; it is already written, and a 40 kB advantage over a WASM blob matters more than sharing a codebase |
| should /spec render the specification or link the file | render, with the raw file one click away — but the generic renderer must exist first |
| is a light theme worth maintaining | no, in v0 |
| does the banner earn its complexity on a phone | unknown; the single-plane fallback may be the honest answer everywhere |