The buffer to add padding to.
The padded buffer.
Safe function to merge multiple Uint8Arrays into a single Uint8array. This works with buffers of any size.
The buffers to combine.
The combined buffers.
Get a hexadecimal string as Uint8Array.
The hexadecimal string to convert to a buffer.
The buffer.
Get a UTF-8 encoded string as buffer.
The string to convert to a buffer.
The buffer.
Returns an instance of TextDecoder
that works with both Node.js and web browsers.
Returns an instance of TextEncoder
that works with both Node.js and web browsers.
Attempt to parse a value as Uint8Array. If data
is a number, this will pad the buffer to 32 bytes.
The value to parse as Uint8Array.
The resulting Uint8Array.
Get a Uint8Array as hexadecimal string.
The buffer to convert to a hexadecimal string.
The buffer as hexadecimal string.
Get a number from a buffer. Returns zero if the buffer is empty.
The buffer to get a number for.
The parsed number.
Get a buffer as UTF-8 encoded string.
The buffer to convert to UTF-8.
The buffer as UTF-8 encoded string.
Generated using TypeDoc
Add padding to a buffer. If the buffer is larger than
length
, this function won't do anything. If it's smaller, the buffer will be padded to the specified length, with extra zeroes at the end.