CBORReader

CBOR reader.

Static Members

Properties

Methods


Constructor

.constructor(data: Uint8Array) ⇒ CBORReader

ParamTypeDescription
dataUint8Array

Properties

.data: Uint8Array


.dataView: DataView


.dictionary: ‘object’ | ‘map’


.offset: number


.tagger: Tagger



Methods

.appendUtf16Data(utf16data: number[], length: number) ⇒ void

ParamTypeDescription
utf16datanumber[]
lengthnumber

.decodeItem() ⇒ any


.readArrayBuffer(length: number) ⇒ Uint8Array

ParamTypeDescription
lengthnumber

.readArrayLength(typeInfo: number) ⇒ number | bigint

Read the array length.

Note: Must not be called if the type is a constant.

Returns: The array length.

ParamTypeDescription
typeInfonumberType information obtained using readTypeInfo.

.readBreak() ⇒ boolean


.readFloat16() ⇒ number


.readFloat32() ⇒ number


.readFloat64() ⇒ number


.readIndefiniteStringLength(majorType: number) ⇒ number

ParamTypeDescription
majorTypenumber

.readItem(typeInfo: number, inputLen: null | number) ⇒ any

Recursively read the item.

Note: This method will recursively allocate arrays and records based the item type.

Returns: The decoded value.

ParamTypeDescription
typeInfonumberType information obtained using readTypeInfo.
inputLennull | number

.readLength(additionalInformation: number) ⇒ number | bigint

ParamTypeDescription
additionalInformationnumber

.readTypeInfo() ⇒ number

Read type information and move the cursor.

Note: Must be called before reading the value.


.readUint16() ⇒ number


.readUint32() ⇒ number


.readUint64() ⇒ bigint


.readUint8() ⇒ number