Skip to main content
Home
This release is 14 versions behind 1.0.10 — the latest version of @std/encoding. Jump to latest

@std/encoding@0.224.0
Built and signed on GitHub Actions

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%
Downloads61,722/wk
Published2 years ago (0.224.0)

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

ascii85

Utilities for working with ascii85 encoding.

I
Ascii85Options

Options for encodeAscii85 and decodeAscii85.

T
Ascii85Standard

Supported ascii85 standards for Ascii85Options.

f
decodeAscii85

Decodes a ascii85-encoded string.

f
encodeAscii85

Converts data into an ascii58-encoded string.

base32

Utilities for base32 encoding and decoding.

f
decodeBase32

Decodes a base32-encoded string.

f
encodeBase32

Converts data into a base32-encoded string.

base58

Utilities for base58 encoding and decoding.

f
decodeBase58

Decodes a base58-encoded string.

f
encodeBase58

Converts data into a base58-encoded string.

base64

Utilities for base64 encoding and decoding.

f
decodeBase64

Decodes a base64-encoded string.

f
encodeBase64

Converts data into a base64-encoded string.

base64url

Utilities for base64url encoding and decoding.

f
decodeBase64Url

Decodes a given base64url-encoded string.

f
encodeBase64Url

Convert data into a base64url-encoded string.

hex

Port of the Go encoding/hex library.

f
decodeHex

Decodes the given hex-encoded string. If the input is malformed, an error is thrown.

f
encodeHex

Converts data into a hex-encoded string.

varint

Functions for encoding typed integers in array buffers.

f
decodeVarint

Given a non empty 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
decodeVarint32

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
encodeVarint

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
f
decode

Given a non empty 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.

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.