Skip to main content
Home
This release is 37 versions behind 1.0.10 — the latest version of @std/encoding. Jump to latest
Works with
This package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers
This package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
This package works with Bun
This package works with Browsers
JSR Score100%
Downloads65,825/wk
Published2 years ago (0.206.0)

Utilities for encoding and decoding common formats like hex, base64, and varint

I
Ascii85Options

encoding/decoding options

T
Ascii85Standard

encode and decode for Ascii85/base85 encoding.

f
decodeAscii85

Decodes a given ascii85 encoded string.

f
encodeAscii85

Encodes a given Uint8Array into ascii85, supports multiple standards

v
decode
No documentation available
v
encode
No documentation available
f
byteLength

Returns number of bytes encoded in the given RFC4648 base32 string input.

f
decodeBase32

Decodes a given RFC4648 base32 encoded string.

f
encodeBase32

Encodes a given Uint8Array into RFC4648 base32 representation

v
decode
No documentation available
v
encode
No documentation available
f
decodeBase58

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

f
encodeBase58

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

v
decode
No documentation available
v
encode
No documentation available
f
decodeBase64

Decodes a given RFC4648 base64 encoded string

f
encodeBase64

Encodes a given Uint8Array, ArrayBuffer or string into RFC4648 base64 representation

v
decode
No documentation available
v
encode
No documentation available

base64url

encodeBase64Url and decodeBase64Url for base64 URL safe encoding.

f
decodeBase64Url

Converts given base64url encoded data back to original

f
encodeBase64Url

Encodes a given ArrayBuffer or string into a base64url representation

v
decode
No documentation available
v
encode
No documentation available
f
decodeHex

Decodes the given hex string to Uint8Array. If the input is malformed, an error will be thrown.

f
encodeHex

Encodes the source into hex string.

f
decode
No documentation available
f
encode
No documentation available

varint

Functions for encoding typed integers in array buffers.

f
decode

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.

f
decode32

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.

f
encode

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.

v
MaxUInt64

Functions for encoding typed integers in array buffers.

v
MaxVarIntLen32
No documentation available
v
MaxVarIntLen64
No documentation available

Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.