QuickBEAM.VM.Runtime.Web.Buffer.Encoding (QuickBEAM v0.10.9)

Copy Markdown View Source

Encoding helpers for Node-compatible Buffer operations.

Summary

Functions

Returns the byte length of a string under a Node-compatible Buffer encoding.

Compares two binaries using Buffer comparison ordering.

Decodes a JavaScript Buffer string input using a Node-compatible encoding name.

Encodes Buffer bytes as a JavaScript string using a Node-compatible encoding name.

Repeats a string pattern into a binary of exactly n bytes.

Slices a binary after clamping start and end offsets to valid bounds.

Functions

byte_length(str, encoding)

Returns the byte length of a string under a Node-compatible Buffer encoding.

compare(a, b)

Compares two binaries using Buffer comparison ordering.

decode(str, encoding)

Decodes a JavaScript Buffer string input using a Node-compatible encoding name.

encode(bytes, encoding)

Encodes Buffer bytes as a JavaScript string using a Node-compatible encoding name.

fill(n, pattern)

Repeats a string pattern into a binary of exactly n bytes.

safe_slice(bytes, start_i, end_i)

Slices a binary after clamping start and end offsets to valid bounds.