| cbor_diagnose | R Documentation |
Shows CBOR as RFC 8949 section 8 diagnostic notation: the human-readable
form CBOR specifications use for examples. The input is checked first,
exactly as cbor_validate() checks it, so nothing hostile reaches the
printer, and the output is bounded by the input's size.
cbor_diagnose(
x,
sequence = FALSE,
deterministic = FALSE,
duplicate_keys = FALSE,
max_depth = 256L,
max_size = 64 * 1024^2,
max_items = 1e+06
)
x |
A raw vector. |
sequence |
If |
deterministic |
If |
duplicate_keys |
If |
max_depth |
Deepest nesting allowed, counting arrays, maps and tags.
At most |
max_size |
Largest input allowed, in bytes, or |
max_items |
Most data items allowed, counting every tag and every
chunk of an indefinite-length string, or |
The notation matches RFC 8949's own Appendix A. Numbers print as JSON and
JavaScript print them, with .0 added to a float that would otherwise
read as an integer (1.0, 1.0e+300). Text is ASCII: characters beyond
it appear as \u escapes, as Appendix A writes them. An indefinite-length
item shows _ after its opening bracket, and a chunked string its chunks
as (_ "a", "b"). A sequence's items are separated by commas (RFC 8742
section 4.2).
A single string.
cbor_decode() to turn CBOR into R values.
cbor_diagnose(as.raw(c(0xa2, 0x61, 0x61, 0x01, 0x61, 0x62, 0x82, 0x02, 0x03)))
cbor_diagnose(cbor_encode(list(when = Sys.Date(), pi = pi, bytes = as.raw(1:4))))
cbor_diagnose(as.raw(c(0x01, 0xf9, 0x3e, 0x00)), sequence = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.