Skip to content

Documentation / @andrew_l/tl-pack / tlEncode

Function: tlEncode() ​

tlEncode(value, opts?): Uint8Array

Encode any value into Uint8Array

Parameters ​

value ​

unknown

opts? ​

BinaryWriterOptions

Returns ​

Uint8Array

Example ​

ts
const buffer = tlEncode(new Date(0));

console.log(buffer); // Uint8Array([5, 0, 0, 0, 0, 0, 0, 0, 0])