Private
bufferPrivate
offsetDeserializes a string. UTF8 string is supported. Reads the string's bytes length "l" first, and then reads "l" bytes of content. Decodes the byte array into a string.
BCS layout for "string": string_length | string_content. string_length is the bytes length of the string that is uleb128 encoded. string_length is a u32 integer.
const deserializer = new Deserializer(new Uint8Array([24, 0xc3, 0xa7, 0xc3, 0xa5, 0xe2, 0x88, 0x9e,
0xe2, 0x89, 0xa0, 0xc2, 0xa2, 0xc3, 0xb5, 0xc3, 0x9f, 0xe2, 0x88, 0x82, 0xc6, 0x92, 0xe2, 0x88, 0xab]));
assert(deserializer.deserializeStr() === "çå∞≠¢õß∂ƒ∫");
Deserializes a uint64 number.
BCS layout for "uint64": Eight bytes. Binary format in little-endian representation.
const deserializer = new Deserializer(new Uint8Array([0x00, 0xEF, 0xCD, 0xAB, 0x78, 0x56, 0x34, 0x12]));
assert(deserializer.deserializeU64() === 1311768467750121216);
Private
readGenerated using TypeDoc
Deserializes a boolean value.
BCS layout for "boolean": One byte. "0x01" for True and "0x00" for False.