Create a tokeniser
the buffer to tokenise
the starting position in the buffer
the number of bytes to read from the buffer
The offset from which to start reading in the buffer
The token context
The buffer to tokenise
The number of bytes in the buffer
The current position
The current token
The current token type
Get the current context
Get the current token
Check if more tokens can be read from the buffer
true if there are more tokens
Read the next token and return it
the next token or null if no more tokens are remaining in the buffer
Return the current reading position in the buffer
Read a number of bytes and return them as a buffer
the byte read from the buffer
Read a single byte from the buffer
the byte read from the buffer
Read the length of a collection
the CBOR header
the number of elements in the collection or -1 for an empty collection
Read a 16 bit float from the buffer
the value read from the buffer
See: http://stackoverflow.com/questions/5678432/decompressing-half-precision-floats-in-javascript
Read a 32 bit float from the buffer
the value read from the buffer
Read a 64 bit float from the buffer
the value read from the buffer
Read a value header from the buffer
the header information read from the buffer
Read a header value
the header type information
a flag indicating if the value is negative
the header value
Read a primitive value
the type of the value to read
the value that was read. A break is signalled by an Error being returned (not thrown).
Read a 16 bit unsigned integer from the buffer
the value read from the buffer
Read a 32 bit unsigned integer from the buffer
the value read from the buffer
Read a 64 bit unsigned integer from the buffer
the value read from the buffer. If it is possible to represent
the integer using the primitive number type, a number is returned,
otherwise an Int64.
Read a value from the CBOR buffer
the type information from the vallue's header
the value that was read
Reset the tokeniser
Copyright © 2025 DiffusionData Ltd. All Rights Reserved.
Tokeniser for CBOR objects