Utilities for encoding and decoding common formats like hex, base64, and varint
encode and decode for
Ascii85/base85 encoding.
Decodes a given ascii85 encoded string.
Encodes a given Uint8Array into ascii85, supports multiple standards
Returns number of bytes encoded in the given RFC4648 base32 string input.
Decodes a given RFC4648 base32 encoded string.
Encodes a given Uint8Array into RFC4648 base32 representation
Decodes a given b58 string according to draft-mspotny-base58-03 RFC base58 representation: https://tools.ietf.org/id/draft-msporny-base58-01.html#rfc.section.1
Encodes a given Uint8Array, ArrayBuffer or string into draft-mspotny-base58-03 RFC base58 representation: https://tools.ietf.org/id/draft-msporny-base58-01.html#rfc.section.1
Decodes a given RFC4648 base64 encoded string
Encodes a given Uint8Array, ArrayBuffer or string into RFC4648 base64 representation
base64url
encodeBase64Url and decodeBase64Url for
base64 URL safe encoding.
Converts given base64url encoded data back to original
Encodes a given ArrayBuffer or string into a base64url representation
varint
Functions for encoding typed integers in array buffers.
Given a buf, starting at offset (default: 0), begin decoding bytes as
VarInt encoded bytes, for a maximum of 10 bytes (offset + 10). The returned
tuple is of the decoded varint 32-bit number, and the new offset with which
to continue decoding other data.
Given a buf, starting at offset (default: 0), begin decoding bytes as
VarInt encoded bytes, for a maximum of 5 bytes (offset + 5). The returned
tuple is of the decoded varint 32-bit number, and the new offset with which
to continue decoding other data.
Takes unsigned number num and converts it into a VarInt encoded
Uint8Array, returning a tuple consisting of a Uint8Array slice of the
encoded VarInt, and an offset where the VarInt encoded bytes end within the
Uint8Array.
Functions for encoding typed integers in array buffers.