gdDocumentation0.8.0

API reference

GD.data

Data conversion for bytes, binary codecs, hashes, key derivation, and in-memory CSV, INI, TOML, YAML, JSON, XML, and related formats. Invalid input and settings return failures.

Methods

gzip_writer

gzip_writer(writer: RefCounted, level: int = -1) -> GDGzipWriter, Err

Create a compressor writing to a byte destination.

Create a GDGzipWriter over a byte Writer. Compression runs on CPU workers and preserves downstream backpressure. Levels: -2 Huffman only, -1 default, 0..9. Close finishes the gzip member but leaves the destination open; reset reuses the compressor at the same level.

Parameters

NameTypeDefaultDescription
writerRefCountedRequiredByte destination exposing a write operation.
levelint-1Compression level: -2 Huffman only, -1 default, or 0 through 9.

Return value

GDGzipWriter, Err

Errors

The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.

csv

csv(src: String, sep: String = ",") -> Array, Err

Read and write in-memory document formats.

Parameters

NameTypeDefaultDescription
srcStringRequiredSource input to read or transform; file operations interpret it as a source path.
sepString","Separator used to split or join records or fields.

Return value

Array, Err

Errors

The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.

to_csv

to_csv(rows: Array, sep: String = ",") -> String

Encode rows as delimited text, quoting fields that contain separators, quotes, or line endings.

Parameters

NameTypeDefaultDescription
rowsArrayRequiredRows in input order. Batch database calls use one parameter set per row.
sepString","Separator used to split or join records or fields.

Return value

String

Errors

This call has no Err return slot. Its return type and documented sentinel values determine how to inspect the result.

csv_objects

csv_objects(src: String, sep: String = ",") -> Array, Err

Parse delimited text using its first row as field names for the remaining object rows.

Parameters

NameTypeDefaultDescription
srcStringRequiredSource input to read or transform; file operations interpret it as a source path.
sepString","Separator used to split or join records or fields.

Return value

Array, Err

Errors

The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.

to_csv_objects

to_csv_objects(items: Array, sep: String = ",") -> String

Encode object rows as delimited text with a header row naming their fields.

Parameters

NameTypeDefaultDescription
itemsArrayRequiredInput elements to transform or collect, in their supplied order.
sepString","Separator used to split or join records or fields.

Return value

String

Errors

This call has no Err return slot. Its return type and documented sentinel values determine how to inspect the result.

ini

ini(src: String) -> Dictionary, Err

Parse sectioned key-value text into a dictionary.

Parameters

NameTypeDefaultDescription
srcStringRequiredSource input to read or transform; file operations interpret it as a source path.

Return value

Dictionary, Err

Errors

The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.

to_ini

to_ini(data: Dictionary) -> String

Serialize a dictionary as sectioned key-value text.

Parameters

NameTypeDefaultDescription
dataDictionaryRequiredInput data in the representation shown by the parameter type.

Return value

String

Errors

This call has no Err return slot. Its return type and documented sentinel values determine how to inspect the result.

toml

toml(src: String) -> Dictionary, Err

Parse configuration text into its structured values and report malformed input.

Parameters

NameTypeDefaultDescription
srcStringRequiredSource input to read or transform; file operations interpret it as a source path.

Return value

Dictionary, Err

Errors

The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.

to_toml

to_toml(data: Dictionary, prefix: String = "") -> String, Err

Serialize configuration values with an optional table prefix; unsupported values return an error.

Return the encoded value and Err. Inputs that cannot be represented produce an Err instead of omitted entries or an empty success value.

Parameters

NameTypeDefaultDescription
dataDictionaryRequiredInput data in the representation shown by the parameter type.
prefixString""Table path prefix prepended to encoded tables.

Return value

String, Err

Errors

The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.

yaml

yaml(src: String) -> Variant, Err

Parse indentation-based document text into structured values and report malformed input.

Parameters

NameTypeDefaultDescription
srcStringRequiredSource input to read or transform; file operations interpret it as a source path.

Return value

Variant, Err

Errors

The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.

to_yaml

to_yaml(data: Variant, depth: int = 0) -> String, Err

Serialize structured values using the requested initial indentation depth.

Return the encoded value and Err. Inputs that cannot be represented produce an Err instead of omitted entries or an empty success value.

Parameters

NameTypeDefaultDescription
dataVariantRequiredInput data in the representation shown by the parameter type.
depthint0Initial nesting or indentation depth for serialization.

Return value

String, Err

Errors

The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.

jsonc

jsonc(src: String) -> Variant, Err

Decode JSON text permitting comments and trailing commas.

Parameters

NameTypeDefaultDescription
srcStringRequiredSource input to read or transform; file operations interpret it as a source path.

Return value

Variant, Err

Errors

The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.

strip_jsonc

strip_jsonc(src: String) -> String

Remove comments and trailing commas from JSON-like text before strict decoding.

Parameters

NameTypeDefaultDescription
srcStringRequiredSource input to read or transform; file operations interpret it as a source path.

Return value

String

Errors

This call has no Err return slot. Its return type and documented sentinel values determine how to inspect the result.

jsonl

jsonl(src: String) -> Array, Err

Decode newline-delimited JSON records into an array; malformed records return an error.

Parameters

NameTypeDefaultDescription
srcStringRequiredSource input to read or transform; file operations interpret it as a source path.

Return value

Array, Err

Errors

The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.

to_jsonl

to_jsonl(items: Array) -> String, Err

Encode each supplied value as one JSON record terminated by a newline.

Parameters

NameTypeDefaultDescription
itemsArrayRequiredInput elements to transform or collect, in their supplied order.

Return value

String, Err

Errors

The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.

jsonl_reader

jsonl_reader() -> GDJSONLReader

Create a sequential JSON Lines reader.

Parameters

No parameters.

Return value

GDJSONLReader

Errors

This call has no Err return slot. Its return type and documented sentinel values determine how to inspect the result.

front_matter

front_matter(src: String) -> Dictionary, Err

Split document metadata from the body and parse its declared metadata format.

Parameters

NameTypeDefaultDescription
srcStringRequiredSource input to read or transform; file operations interpret it as a source path.

Return value

Dictionary, Err

Errors

The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.

has_front_matter

has_front_matter(src: String) -> bool

Return whether the document begins with a recognized metadata delimiter.

Parameters

NameTypeDefaultDescription
srcStringRequiredSource input to read or transform; file operations interpret it as a source path.

Return value

bool

Errors

This call has no Err return slot. Its return type and documented sentinel values determine how to inspect the result.

to_front_matter

to_front_matter(attrs: Dictionary, body: String, kind: String = "yaml") -> String, Err

Encode attributes in the selected metadata format and prepend them to the document body.

Return the encoded value and Err. Inputs that cannot be represented produce an Err instead of omitted entries or an empty success value.

Parameters

NameTypeDefaultDescription
attrsDictionaryRequiredNamed attributes to encode in markup or document metadata.
bodyStringRequiredContent to write or include in the response.
kindString"yaml"Metadata format: yaml, toml or json.

Return value

String, Err

Errors

The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.

xml

xml(src: String) -> Dictionary, Err

Parse markup text into a structured dictionary and report malformed input.

Parameters

NameTypeDefaultDescription
srcStringRequiredSource input to read or transform; file operations interpret it as a source path.

Return value

Dictionary, Err

Errors

The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.

to_xml

to_xml(data: Dictionary, indent: int = 0) -> String, Err

Encode a document dictionary as markup using the supplied indentation width.

Return the encoded value and Err. Inputs that cannot be represented produce an Err instead of omitted entries or an empty success value.

Parameters

NameTypeDefaultDescription
dataDictionaryRequiredInput data in the representation shown by the parameter type.
indentint0Number of spaces per indentation level.

Return value

String, Err

Errors

The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.

env

env(src: String) -> Dictionary, Err

Parse environment-assignment text into a dictionary without changing process variables.

Return an environment dictionary and Err. Invalid names and unterminated quotes return an Err.

Parameters

NameTypeDefaultDescription
srcStringRequiredSource input to read or transform; file operations interpret it as a source path.

Return value

Dictionary, Err

Errors

The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.

to_env

to_env(data: Dictionary) -> String, Err

Encode key-value pairs as environment assignments, quoting values when necessary.

Return the encoded value and Err. Inputs that cannot be represented produce an Err instead of omitted entries or an empty success value.

Parameters

NameTypeDefaultDescription
dataDictionaryRequiredInput data in the representation shown by the parameter type.

Return value

String, Err

Errors

The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.

tar

tar(entries: Array) -> PackedByteArray, Err

Pack named entries into an in-memory archive without writing files.

Return the encoded value and Err. Inputs that cannot be represented produce an Err instead of omitted entries or an empty success value.

Parameters

NameTypeDefaultDescription
entriesArrayRequiredArchive entries containing their names and content.

Return value

PackedByteArray, Err

Errors

The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.

untar

untar(data: PackedByteArray) -> Array, Err

Decode an in-memory archive into entries without extracting them onto the filesystem.

Parameters

NameTypeDefaultDescription
dataPackedByteArrayRequiredInput data in the representation shown by the parameter type.

Return value

Array, Err

Errors

The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.

json_encode

json_encode(value: Variant, opts: Dictionary = {  }) -> PackedByteArray, Err

Encode a value as strict JSON UTF-8 bytes.

Parameters

NameTypeDefaultDescription
valueVariantRequiredValue to serialize.
optsDictionary{ }Encoding options for formatting and validation.

Return value

PackedByteArray, Err

UTF-8 encoded JSON bytes.

Errors

The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.

Unsupported or cyclic values and non-finite numbers return Err.

Non-finite numbers, unsupported types, and cycles fail instead of becoming ambiguous values.

Options: deterministic and escape_html are bool; max_bytes and max_depth are int. A wrong type returns Err.INVALID_DATA, and exceeding a limit returns Err.LIMITED.

Keep the input Arrays, Dictionaries, and their children unchanged until json_encode_async() finishes. The options dictionary is copied at the start.

See also

json_decode

json_decode(data: PackedByteArray) -> Variant, Err

Decode bytes as strict JSON.

Parameters

NameTypeDefaultDescription
dataPackedByteArrayRequiredUTF-8 JSON input bytes.

Return value

Variant, Err

Parsed value; a successful null is distinct from a parse failure.

Errors

The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.

Malformed JSON or invalid input encoding returns Err.

Invalid UTF-8 and duplicate names fail. An integer within the signed 64-bit range stays int; fractions, exponents, and out-of-range values become float. \u0000 in strings and keys is preserved.

See also

hex_encode

hex_encode(data: PackedByteArray) -> String

Encode bytes as hexadecimal text.

Parameters

NameTypeDefaultDescription
dataPackedByteArrayRequiredInput data in the representation shown by the parameter type.

Return value

String

Errors

This call has no Err return slot. Its return type and documented sentinel values determine how to inspect the result.

hex_decode

hex_decode(text: String) -> PackedByteArray, Err

Decode hexadecimal text into bytes.

Parameters

NameTypeDefaultDescription
textStringRequiredText to inspect, decode or transform; the input is not modified in place.

Return value

PackedByteArray, Err

Errors

The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.

base64_encode

base64_encode(data: PackedByteArray) -> String

Encode bytes as Base64 text.

Parameters

NameTypeDefaultDescription
dataPackedByteArrayRequiredInput data in the representation shown by the parameter type.

Return value

String

Errors

This call has no Err return slot. Its return type and documented sentinel values determine how to inspect the result.

base64_decode

base64_decode(text: String, raw: bool = false) -> PackedByteArray, Err

Decode Base64 text into bytes.

Decode with standard padding by default; raw=true selects unpadded input. Return partial bytes with Err. Base32 uses uppercase letters.

Parameters

NameTypeDefaultDescription
textStringRequiredText to inspect, decode or transform; the input is not modified in place.
rawboolfalseWhether unpadded input is decoded using the raw alphabet form.

Return value

PackedByteArray, Err

Errors

The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.

base64url_encode

base64url_encode(data: PackedByteArray) -> String

Encode bytes as URL-safe Base64 text.

Parameters

NameTypeDefaultDescription
dataPackedByteArrayRequiredInput data in the representation shown by the parameter type.

Return value

String

Errors

This call has no Err return slot. Its return type and documented sentinel values determine how to inspect the result.

base64url_decode

base64url_decode(text: String, raw: bool = true) -> PackedByteArray, Err

Decode URL-safe Base64 text into bytes.

Decode the URL-safe alphabet; raw=true is the default. Set raw=false for padded input. Identity-sensitive signature parsing applies separate canonical checks.

Parameters

NameTypeDefaultDescription
textStringRequiredText to inspect, decode or transform; the input is not modified in place.
rawbooltrueWhether to decode an unpadded representation.

Return value

PackedByteArray, Err

Errors

The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.

base32_encode

base32_encode(data: PackedByteArray) -> String

Encode bytes as Base32 text.

Parameters

NameTypeDefaultDescription
dataPackedByteArrayRequiredInput data in the representation shown by the parameter type.

Return value

String

Errors

This call has no Err return slot. Its return type and documented sentinel values determine how to inspect the result.

base32_decode

base32_decode(text: String, raw: bool = false) -> PackedByteArray, Err

Decode Base32 text into bytes.

Decode with standard padding by default; raw=true selects unpadded input. Return partial bytes with Err. Base32 uses uppercase letters.

Parameters

NameTypeDefaultDescription
textStringRequiredText to inspect, decode or transform; the input is not modified in place.
rawboolfalseWhether to decode an unpadded representation.

Return value

PackedByteArray, Err

Errors

The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.

varint_encode

varint_encode(n: int) -> PackedByteArray

Encode an integer as variable-length bytes.

Parameters

NameTypeDefaultDescription
nintRequiredInteger input to encode or use as the operation's numeric argument.

Return value

PackedByteArray

Errors

This call has no Err return slot. Its return type and documented sentinel values determine how to inspect the result.

varint_decode

varint_decode(data: PackedByteArray, at: int = 0) -> Dictionary, Err

Read an integer from variable-length bytes.

Parameters

NameTypeDefaultDescription
dataPackedByteArrayRequiredInput data in the representation shown by the parameter type.
atint0Zero-based byte offset at which decoding begins.

Return value

Dictionary, Err

Errors

The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.

concat

concat(parts: Array) -> PackedByteArray

Concatenate byte sequences.

Parameters

NameTypeDefaultDescription
partsArrayRequiredComponents assembled by the operation, in the representation shown by the type.

Return value

PackedByteArray

Errors

This call has no Err return slot. Its return type and documented sentinel values determine how to inspect the result.

equals

equals(a: PackedByteArray, b: PackedByteArray) -> bool

Check whether two byte sequences are equal.

Parameters

NameTypeDefaultDescription
aPackedByteArrayRequiredFirst input or comparison operand.
bPackedByteArrayRequiredSecond input or comparison operand.

Return value

bool

Errors

This call has no Err return slot. Its return type and documented sentinel values determine how to inspect the result.

includes

includes(hay: PackedByteArray, needle: PackedByteArray) -> bool

Check whether bytes contain a subsequence.

Parameters

NameTypeDefaultDescription
hayPackedByteArrayRequiredByte sequence searched for the requested pattern.
needlePackedByteArrayRequiredByte pattern to find in the searched sequence.

Return value

bool

Errors

This call has no Err return slot. Its return type and documented sentinel values determine how to inspect the result.

index_of

index_of(hay: PackedByteArray, needle: PackedByteArray, from: int = 0) -> int

Return the first byte-subsequence position.

Parameters

NameTypeDefaultDescription
hayPackedByteArrayRequiredByte sequence searched for the requested pattern.
needlePackedByteArrayRequiredByte pattern to find in the searched sequence.
fromint0Starting point used by the operation.

Return value

int

Errors

This call has no Err return slot. Its return type and documented sentinel values determine how to inspect the result.

last_index_of

last_index_of(hay: PackedByteArray, needle: PackedByteArray) -> int

Return the last byte-subsequence position.

Parameters

NameTypeDefaultDescription
hayPackedByteArrayRequiredByte sequence searched for the requested pattern.
needlePackedByteArrayRequiredByte pattern to find in the searched sequence.

Return value

int

Errors

This call has no Err return slot. Its return type and documented sentinel values determine how to inspect the result.

starts_with

starts_with(hay: PackedByteArray, prefix: PackedByteArray) -> bool

Check whether bytes begin with a prefix.

Parameters

NameTypeDefaultDescription
hayPackedByteArrayRequiredByte sequence searched for the requested pattern.
prefixPackedByteArrayRequiredPrefix applied when constructing the resulting names, paths or output.

Return value

bool

Errors

This call has no Err return slot. Its return type and documented sentinel values determine how to inspect the result.

ends_with

ends_with(hay: PackedByteArray, suffix: PackedByteArray) -> bool

Check whether bytes end with a suffix.

Parameters

NameTypeDefaultDescription
hayPackedByteArrayRequiredByte sequence searched for the requested pattern.
suffixPackedByteArrayRequiredSuffix to test or remove from the end of the input.

Return value

bool

Errors

This call has no Err return slot. Its return type and documented sentinel values determine how to inspect the result.

repeat

repeat(src: PackedByteArray, times: int) -> PackedByteArray

Repeat a byte sequence the specified number of times.

Parameters

NameTypeDefaultDescription
srcPackedByteArrayRequiredSource input to read or transform; file operations interpret it as a source path.
timesintRequiredNumber of repetitions of the input sequence.

Return value

PackedByteArray

Errors

This call has no Err return slot. Its return type and documented sentinel values determine how to inspect the result.

fit

fit(src: PackedByteArray, size: int) -> PackedByteArray

Resize a byte sequence to the specified length.

Parameters

NameTypeDefaultDescription
srcPackedByteArrayRequiredSource input to read or transform; file operations interpret it as a source path.
sizeintRequiredRequested output length in bytes.

Return value

PackedByteArray

Errors

This call has no Err return slot. Its return type and documented sentinel values determine how to inspect the result.

split

split(src: PackedByteArray, sep: PackedByteArray) -> Array

Split bytes on a delimiter sequence.

Parameters

NameTypeDefaultDescription
srcPackedByteArrayRequiredSource input to read or transform; file operations interpret it as a source path.
sepPackedByteArrayRequiredSeparator used to split or join records or fields.

Return value

Array

Errors

This call has no Err return slot. Its return type and documented sentinel values determine how to inspect the result.

msgpack

msgpack(value: Variant) -> PackedByteArray, Err

Encode a value as MessagePack.

Return the encoded value and Err. Inputs that cannot be represented produce an Err instead of omitted entries or an empty success value.

Parameters

NameTypeDefaultDescription
valueVariantRequiredStructured value to serialize into the selected data format.

Return value

PackedByteArray, Err

Errors

The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.

unmsgpack

unmsgpack(data: PackedByteArray) -> Variant, Err

Decode MessagePack into a value.

Decode MessagePack without losing text bytes. Non-UTF-8 or NUL-containing text remains PackedByteArray; leading BOM is preserved.

Parameters

NameTypeDefaultDescription
dataPackedByteArrayRequiredInput data in the representation shown by the parameter type.

Return value

Variant, Err

Errors

The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.

cbor

cbor(value: Variant) -> PackedByteArray, Err

Encode a value as CBOR.

Return the encoded value and Err. Inputs that cannot be represented produce an Err instead of omitted entries or an empty success value.

Parameters

NameTypeDefaultDescription
valueVariantRequiredStructured value to serialize into the selected data format.

Return value

PackedByteArray, Err

Errors

The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.

uncbor

uncbor(data: PackedByteArray) -> Variant, Err

Decode CBOR into a value.

Decode CBOR and report malformed UTF-8 text as Err. Valid text containing NUL remains PackedByteArray without truncation.

Parameters

NameTypeDefaultDescription
dataPackedByteArrayRequiredInput data in the representation shown by the parameter type.

Return value

Variant, Err

Errors

The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.

sha224

sha224(msg: PackedByteArray) -> PackedByteArray

Compute a SHA-224 digest.

Parameters

NameTypeDefaultDescription
msgPackedByteArrayRequiredBytes to hash or authenticate.

Return value

PackedByteArray

Errors

This call has no Err return slot. Its return type and documented sentinel values determine how to inspect the result.

sha256

sha256(msg: PackedByteArray) -> PackedByteArray

Compute a SHA-256 digest.

Parameters

NameTypeDefaultDescription
msgPackedByteArrayRequiredBytes to hash or authenticate.

Return value

PackedByteArray

Errors

This call has no Err return slot. Its return type and documented sentinel values determine how to inspect the result.

sha384

sha384(msg: PackedByteArray) -> PackedByteArray

Compute a SHA-384 digest.

Parameters

NameTypeDefaultDescription
msgPackedByteArrayRequiredBytes to hash or authenticate.

Return value

PackedByteArray

Errors

This call has no Err return slot. Its return type and documented sentinel values determine how to inspect the result.

sha512

sha512(msg: PackedByteArray) -> PackedByteArray

Compute a SHA-512 digest.

Parameters

NameTypeDefaultDescription
msgPackedByteArrayRequiredBytes to hash or authenticate.

Return value

PackedByteArray

Errors

This call has no Err return slot. Its return type and documented sentinel values determine how to inspect the result.

sha3_224

sha3_224(msg: PackedByteArray) -> PackedByteArray

Compute a SHA3-224 digest.

Parameters

NameTypeDefaultDescription
msgPackedByteArrayRequiredBytes to hash or authenticate.

Return value

PackedByteArray

Errors

This call has no Err return slot. Its return type and documented sentinel values determine how to inspect the result.

sha3_256

sha3_256(msg: PackedByteArray) -> PackedByteArray

Compute a SHA3-256 digest.

Parameters

NameTypeDefaultDescription
msgPackedByteArrayRequiredBytes to hash or authenticate.

Return value

PackedByteArray

Errors

This call has no Err return slot. Its return type and documented sentinel values determine how to inspect the result.

sha3_384

sha3_384(msg: PackedByteArray) -> PackedByteArray

Compute a SHA3-384 digest.

Parameters

NameTypeDefaultDescription
msgPackedByteArrayRequiredBytes to hash or authenticate.

Return value

PackedByteArray

Errors

This call has no Err return slot. Its return type and documented sentinel values determine how to inspect the result.

sha3_512

sha3_512(msg: PackedByteArray) -> PackedByteArray

Compute a SHA3-512 digest.

Parameters

NameTypeDefaultDescription
msgPackedByteArrayRequiredBytes to hash or authenticate.

Return value

PackedByteArray

Errors

This call has no Err return slot. Its return type and documented sentinel values determine how to inspect the result.

sha1

sha1(msg: PackedByteArray) -> PackedByteArray

Compute a SHA-1 digest.

Parameters

NameTypeDefaultDescription
msgPackedByteArrayRequiredBytes to hash or authenticate.

Return value

PackedByteArray

Errors

This call has no Err return slot. Its return type and documented sentinel values determine how to inspect the result.

hmac

hmac(hash: String, key: PackedByteArray, msg: PackedByteArray) -> PackedByteArray, Err

Compute HMAC with the selected hash.

Parameters

NameTypeDefaultDescription
hashStringRequiredDigest algorithm name selected for the operation.
keyPackedByteArrayRequiredAuthentication key or pseudorandom key bytes for this operation.
msgPackedByteArrayRequiredBytes to hash or authenticate.

Return value

PackedByteArray, Err

Errors

The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.

hmac_sha256

hmac_sha256(key: PackedByteArray, msg: PackedByteArray) -> PackedByteArray

Compute HMAC-SHA-256.

Parameters

NameTypeDefaultDescription
keyPackedByteArrayRequiredAuthentication key or pseudorandom key bytes for this operation.
msgPackedByteArrayRequiredBytes to hash or authenticate.

Return value

PackedByteArray

Errors

This call has no Err return slot. Its return type and documented sentinel values determine how to inspect the result.

xor_bytes

xor_bytes(a: PackedByteArray, b: PackedByteArray) -> PackedByteArray

Combine two byte sequences with exclusive OR.

Parameters

NameTypeDefaultDescription
aPackedByteArrayRequiredFirst input or comparison operand.
bPackedByteArrayRequiredSecond input or comparison operand.

Return value

PackedByteArray

Errors

This call has no Err return slot. Its return type and documented sentinel values determine how to inspect the result.

equal_ct

equal_ct(a: PackedByteArray, b: PackedByteArray) -> bool

Compare two byte sequences in constant time.

Parameters

NameTypeDefaultDescription
aPackedByteArrayRequiredFirst input or comparison operand.
bPackedByteArrayRequiredSecond input or comparison operand.

Return value

bool

Errors

This call has no Err return slot. Its return type and documented sentinel values determine how to inspect the result.

pbkdf2_sha256

pbkdf2_sha256(password: PackedByteArray, salt: PackedByteArray, rounds: int) -> PackedByteArray, Err

Derive a key with PBKDF2-HMAC-SHA-256.

Return a 32-byte derived key and Err. Iteration counts of one or less perform one iteration.

Parameters

NameTypeDefaultDescription
passwordPackedByteArrayRequiredPassword bytes used as key-derivation input.
saltPackedByteArrayRequiredSalt bytes for key derivation; do not substitute the derived key here.
roundsintRequiredNumber of iterations used by the password-based derivation.

Return value

PackedByteArray, Err

Errors

The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.

pbkdf2

pbkdf2(hash: String, password: PackedByteArray, salt: PackedByteArray, rounds: int, size: int) -> PackedByteArray, Err

Derive a PBKDF2 key with the selected hash and output length.

Parameters

NameTypeDefaultDescription
hashStringRequiredDigest algorithm name selected for the operation.
passwordPackedByteArrayRequiredPassword bytes used as key-derivation input.
saltPackedByteArrayRequiredSalt bytes for key derivation; do not substitute the derived key here.
roundsintRequiredNumber of iterations used by the password-based derivation.
sizeintRequiredRequested output length in bytes.

Return value

PackedByteArray, Err

Errors

The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.

hkdf

hkdf(hash: String, secret: PackedByteArray, salt: PackedByteArray, info: PackedByteArray, size: int) -> PackedByteArray, Err

Derive an HKDF key from a secret, salt, and context information.

Parameters

NameTypeDefaultDescription
hashStringRequiredDigest algorithm name selected for the operation.
secretPackedByteArrayRequiredInput key material used by the derivation operation.
saltPackedByteArrayRequiredSalt bytes for key derivation; do not substitute the derived key here.
infoPackedByteArrayRequiredApplication-specific context bytes for key derivation.
sizeintRequiredRequested output length in bytes.

Return value

PackedByteArray, Err

Errors

The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.

hkdf_extract

hkdf_extract(hash: String, secret: PackedByteArray, salt: PackedByteArray) -> PackedByteArray, Err

Extract an HKDF pseudorandom key from a secret and salt.

Parameters

NameTypeDefaultDescription
hashStringRequiredDigest algorithm name selected for the operation.
secretPackedByteArrayRequiredInput key material used by the derivation operation.
saltPackedByteArrayRequiredSalt bytes for key derivation; do not substitute the derived key here.

Return value

PackedByteArray, Err

Errors

The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.

hkdf_expand

hkdf_expand(hash: String, key: PackedByteArray, info: PackedByteArray, size: int) -> PackedByteArray, Err

Expand an HKDF key from a pseudorandom key and context information.

Parameters

NameTypeDefaultDescription
hashStringRequiredDigest algorithm name selected for the operation.
keyPackedByteArrayRequiredAuthentication key or pseudorandom key bytes for this operation.
infoPackedByteArrayRequiredApplication-specific context bytes for key derivation.
sizeintRequiredRequested output length in bytes.

Return value

PackedByteArray, Err

Errors

The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.

pbkdf2_sha256_async

pbkdf2_sha256_async(password: PackedByteArray, salt: PackedByteArray, rounds: int) -> await PackedByteArray, Err

Run key derivation on CPU workers.

Parameters

NameTypeDefaultDescription
passwordPackedByteArrayRequiredPassword bytes used as key-derivation input.
saltPackedByteArrayRequiredSalt bytes for key derivation; do not substitute the derived key here.
roundsintRequiredNumber of iterations used by the password-based derivation.

Return value

await PackedByteArray, Err

Returns a Signal. Use await to receive the completion value shown in the signature.

Errors

The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.

pbkdf2_async

pbkdf2_async(hash: String, password: PackedByteArray, salt: PackedByteArray, rounds: int, size: int) -> await PackedByteArray, Err

Dispatch PBKDF2 with the selected hash to a CPU worker.

Parameters

NameTypeDefaultDescription
hashStringRequiredDigest algorithm name selected for the operation.
passwordPackedByteArrayRequiredPassword bytes used as key-derivation input.
saltPackedByteArrayRequiredSalt bytes for key derivation; do not substitute the derived key here.
roundsintRequiredNumber of iterations used by the password-based derivation.
sizeintRequiredRequested output length in bytes.

Return value

await PackedByteArray, Err

Returns a Signal. Use await to receive the completion value shown in the signature.

Errors

The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.

hkdf_async

hkdf_async(hash: String, secret: PackedByteArray, salt: PackedByteArray, info: PackedByteArray, size: int) -> await PackedByteArray, Err

Dispatch HKDF key derivation to a CPU worker.

Parameters

NameTypeDefaultDescription
hashStringRequiredDigest algorithm name selected for the operation.
secretPackedByteArrayRequiredInput key material used by the derivation operation.
saltPackedByteArrayRequiredSalt bytes for key derivation; do not substitute the derived key here.
infoPackedByteArrayRequiredApplication-specific context bytes for key derivation.
sizeintRequiredRequested output length in bytes.

Return value

await PackedByteArray, Err

Returns a Signal. Use await to receive the completion value shown in the signature.

Errors

The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.

hkdf_extract_async

hkdf_extract_async(hash: String, secret: PackedByteArray, salt: PackedByteArray) -> await PackedByteArray, Err

Dispatch HKDF extraction to a CPU worker.

Parameters

NameTypeDefaultDescription
hashStringRequiredDigest algorithm name selected for the operation.
secretPackedByteArrayRequiredInput key material used by the derivation operation.
saltPackedByteArrayRequiredSalt bytes for key derivation; do not substitute the derived key here.

Return value

await PackedByteArray, Err

Returns a Signal. Use await to receive the completion value shown in the signature.

Errors

The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.

hkdf_expand_async

hkdf_expand_async(hash: String, key: PackedByteArray, info: PackedByteArray, size: int) -> await PackedByteArray, Err

Dispatch HKDF expansion to a CPU worker.

Parameters

NameTypeDefaultDescription
hashStringRequiredDigest algorithm name selected for the operation.
keyPackedByteArrayRequiredAuthentication key or pseudorandom key bytes for this operation.
infoPackedByteArrayRequiredApplication-specific context bytes for key derivation.
sizeintRequiredRequested output length in bytes.

Return value

await PackedByteArray, Err

Returns a Signal. Use await to receive the completion value shown in the signature.

Errors

The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.

json_encode_async

json_encode_async(value: Variant, opts: Dictionary = {  }) -> await PackedByteArray, Err

Encode a value as strict JSON UTF-8 bytes.

Parameters

NameTypeDefaultDescription
valueVariantRequiredValue to serialize.
optsDictionary{ }Encoding options for formatting and validation.

Return value

await PackedByteArray, Err

UTF-8 encoded JSON bytes.

Returns a Signal. Use await to receive the completion value shown in the signature.

Errors

The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.

Unsupported or cyclic values and non-finite numbers return Err.

Non-finite numbers, unsupported types, and cycles fail instead of becoming ambiguous values.

Options: deterministic and escape_html are bool; max_bytes and max_depth are int. A wrong type returns Err.INVALID_DATA, and exceeding a limit returns Err.LIMITED.

Keep the input Arrays, Dictionaries, and their children unchanged until json_encode_async() finishes. The options dictionary is copied at the start.

See also

json_decode_async

json_decode_async(data: PackedByteArray) -> await Variant, Err

Decode bytes as strict JSON.

Parameters

NameTypeDefaultDescription
dataPackedByteArrayRequiredUTF-8 JSON input bytes.

Return value

await Variant, Err

Parsed value; a successful null is distinct from a parse failure.

Returns a Signal. Use await to receive the completion value shown in the signature.

Errors

The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.

Malformed JSON or invalid input encoding returns Err.

Invalid UTF-8 and duplicate names fail. An integer within the signed 64-bit range stays int; fractions, exponents, and out-of-range values become float. \u0000 in strings and keys is preserved.

See also

msgpack_async

msgpack_async(value: Variant) -> await PackedByteArray, Err

Dispatch MessagePack encoding to a CPU worker.

Parameters

NameTypeDefaultDescription
valueVariantRequiredStructured value to serialize into the selected data format.

Return value

await PackedByteArray, Err

Returns a Signal. Use await to receive the completion value shown in the signature.

Errors

The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.

unmsgpack_async

unmsgpack_async(data: PackedByteArray) -> await Variant, Err

Dispatch MessagePack decoding to a CPU worker.

Parameters

NameTypeDefaultDescription
dataPackedByteArrayRequiredInput data in the representation shown by the parameter type.

Return value

await Variant, Err

Returns a Signal. Use await to receive the completion value shown in the signature.

Errors

The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.

cbor_async

cbor_async(value: Variant) -> await PackedByteArray, Err

Dispatch CBOR encoding to a CPU worker.

Parameters

NameTypeDefaultDescription
valueVariantRequiredStructured value to serialize into the selected data format.

Return value

await PackedByteArray, Err

Returns a Signal. Use await to receive the completion value shown in the signature.

Errors

The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.

uncbor_async

uncbor_async(data: PackedByteArray) -> await Variant, Err

Dispatch CBOR decoding to a CPU worker.

Parameters

NameTypeDefaultDescription
dataPackedByteArrayRequiredInput data in the representation shown by the parameter type.

Return value

await Variant, Err

Returns a Signal. Use await to receive the completion value shown in the signature.

Errors

The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.

sha224_async

sha224_async(msg: PackedByteArray) -> await PackedByteArray

Dispatch SHA-224 hashing to a CPU worker.

Parameters

NameTypeDefaultDescription
msgPackedByteArrayRequiredBytes to hash or authenticate.

Return value

await PackedByteArray

Returns a Signal. Use await to receive the completion value shown in the signature.

Errors

This call has no Err return slot. Its return type and documented sentinel values determine how to inspect the result.

sha256_async

sha256_async(msg: PackedByteArray) -> await PackedByteArray

Dispatch SHA-256 hashing to a CPU worker.

Parameters

NameTypeDefaultDescription
msgPackedByteArrayRequiredBytes to hash or authenticate.

Return value

await PackedByteArray

Returns a Signal. Use await to receive the completion value shown in the signature.

Errors

This call has no Err return slot. Its return type and documented sentinel values determine how to inspect the result.

sha384_async

sha384_async(msg: PackedByteArray) -> await PackedByteArray

Dispatch SHA-384 hashing to a CPU worker.

Parameters

NameTypeDefaultDescription
msgPackedByteArrayRequiredBytes to hash or authenticate.

Return value

await PackedByteArray

Returns a Signal. Use await to receive the completion value shown in the signature.

Errors

This call has no Err return slot. Its return type and documented sentinel values determine how to inspect the result.

sha512_async

sha512_async(msg: PackedByteArray) -> await PackedByteArray

Dispatch SHA-512 hashing to a CPU worker.

Parameters

NameTypeDefaultDescription
msgPackedByteArrayRequiredBytes to hash or authenticate.

Return value

await PackedByteArray

Returns a Signal. Use await to receive the completion value shown in the signature.

Errors

This call has no Err return slot. Its return type and documented sentinel values determine how to inspect the result.

sha3_224_async

sha3_224_async(msg: PackedByteArray) -> await PackedByteArray

Dispatch SHA3-224 hashing to a CPU worker.

Parameters

NameTypeDefaultDescription
msgPackedByteArrayRequiredBytes to hash or authenticate.

Return value

await PackedByteArray

Returns a Signal. Use await to receive the completion value shown in the signature.

Errors

This call has no Err return slot. Its return type and documented sentinel values determine how to inspect the result.

sha3_256_async

sha3_256_async(msg: PackedByteArray) -> await PackedByteArray

Dispatch SHA3-256 hashing to a CPU worker.

Parameters

NameTypeDefaultDescription
msgPackedByteArrayRequiredBytes to hash or authenticate.

Return value

await PackedByteArray

Returns a Signal. Use await to receive the completion value shown in the signature.

Errors

This call has no Err return slot. Its return type and documented sentinel values determine how to inspect the result.

sha3_384_async

sha3_384_async(msg: PackedByteArray) -> await PackedByteArray

Dispatch SHA3-384 hashing to a CPU worker.

Parameters

NameTypeDefaultDescription
msgPackedByteArrayRequiredBytes to hash or authenticate.

Return value

await PackedByteArray

Returns a Signal. Use await to receive the completion value shown in the signature.

Errors

This call has no Err return slot. Its return type and documented sentinel values determine how to inspect the result.

sha3_512_async

sha3_512_async(msg: PackedByteArray) -> await PackedByteArray

Dispatch SHA3-512 hashing to a CPU worker.

Parameters

NameTypeDefaultDescription
msgPackedByteArrayRequiredBytes to hash or authenticate.

Return value

await PackedByteArray

Returns a Signal. Use await to receive the completion value shown in the signature.

Errors

This call has no Err return slot. Its return type and documented sentinel values determine how to inspect the result.

sha1_async

sha1_async(msg: PackedByteArray) -> await PackedByteArray

Dispatch SHA-1 hashing to a CPU worker.

Parameters

NameTypeDefaultDescription
msgPackedByteArrayRequiredBytes to hash or authenticate.

Return value

await PackedByteArray

Returns a Signal. Use await to receive the completion value shown in the signature.

Errors

This call has no Err return slot. Its return type and documented sentinel values determine how to inspect the result.

hmac_async

hmac_async(hash: String, key: PackedByteArray, msg: PackedByteArray) -> await PackedByteArray, Err

Dispatch HMAC with the selected hash to a CPU worker.

Parameters

NameTypeDefaultDescription
hashStringRequiredDigest algorithm name selected for the operation.
keyPackedByteArrayRequiredAuthentication key or pseudorandom key bytes for this operation.
msgPackedByteArrayRequiredBytes to hash or authenticate.

Return value

await PackedByteArray, Err

Returns a Signal. Use await to receive the completion value shown in the signature.

Errors

The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.

hmac_sha256_async

hmac_sha256_async(key: PackedByteArray, msg: PackedByteArray) -> await PackedByteArray

Dispatch HMAC-SHA-256 to a CPU worker.

Parameters

NameTypeDefaultDescription
keyPackedByteArrayRequiredAuthentication key or pseudorandom key bytes for this operation.
msgPackedByteArrayRequiredBytes to hash or authenticate.

Return value

await PackedByteArray

Returns a Signal. Use await to receive the completion value shown in the signature.

Errors

This call has no Err return slot. Its return type and documented sentinel values determine how to inspect the result.

hex_encode_async

hex_encode_async(data: PackedByteArray) -> await String

Dispatch hexadecimal encoding to a CPU worker.

Parameters

NameTypeDefaultDescription
dataPackedByteArrayRequiredInput data in the representation shown by the parameter type.

Return value

await String

Returns a Signal. Use await to receive the completion value shown in the signature.

Errors

This call has no Err return slot. Its return type and documented sentinel values determine how to inspect the result.

hex_decode_async

hex_decode_async(text: String) -> await PackedByteArray, Err

Dispatch hexadecimal decoding to a CPU worker.

Parameters

NameTypeDefaultDescription
textStringRequiredText to inspect, decode or transform; the input is not modified in place.

Return value

await PackedByteArray, Err

Returns a Signal. Use await to receive the completion value shown in the signature.

Errors

The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.

base64_encode_async

base64_encode_async(data: PackedByteArray) -> await String

Dispatch Base64 encoding to a CPU worker.

Parameters

NameTypeDefaultDescription
dataPackedByteArrayRequiredInput data in the representation shown by the parameter type.

Return value

await String

Returns a Signal. Use await to receive the completion value shown in the signature.

Errors

This call has no Err return slot. Its return type and documented sentinel values determine how to inspect the result.

base64_decode_async

base64_decode_async(text: String, raw: bool = false) -> await PackedByteArray, Err

Dispatch Base64 decoding to a CPU worker.

Parameters

NameTypeDefaultDescription
textStringRequiredText to inspect, decode or transform; the input is not modified in place.
rawboolfalseWhether unpadded input is decoded using the raw alphabet form.

Return value

await PackedByteArray, Err

Returns a Signal. Use await to receive the completion value shown in the signature.

Errors

The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.

base64url_encode_async

base64url_encode_async(data: PackedByteArray) -> await String

Dispatch URL-safe Base64 encoding to a CPU worker.

Parameters

NameTypeDefaultDescription
dataPackedByteArrayRequiredInput data in the representation shown by the parameter type.

Return value

await String

Returns a Signal. Use await to receive the completion value shown in the signature.

Errors

This call has no Err return slot. Its return type and documented sentinel values determine how to inspect the result.

base64url_decode_async

base64url_decode_async(text: String, raw: bool = true) -> await PackedByteArray, Err

Dispatch URL-safe Base64 decoding to a CPU worker.

Parameters

NameTypeDefaultDescription
textStringRequiredText to inspect, decode or transform; the input is not modified in place.
rawbooltrueWhether to decode an unpadded representation.

Return value

await PackedByteArray, Err

Returns a Signal. Use await to receive the completion value shown in the signature.

Errors

The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.

base32_encode_async

base32_encode_async(data: PackedByteArray) -> await String

Dispatch Base32 encoding to a CPU worker.

Parameters

NameTypeDefaultDescription
dataPackedByteArrayRequiredInput data in the representation shown by the parameter type.

Return value

await String

Returns a Signal. Use await to receive the completion value shown in the signature.

Errors

This call has no Err return slot. Its return type and documented sentinel values determine how to inspect the result.

base32_decode_async

base32_decode_async(text: String, raw: bool = false) -> await PackedByteArray, Err

Dispatch Base32 decoding to a CPU worker.

Parameters

NameTypeDefaultDescription
textStringRequiredText to inspect, decode or transform; the input is not modified in place.
rawboolfalseWhether to decode an unpadded representation.

Return value

await PackedByteArray, Err

Returns a Signal. Use await to receive the completion value shown in the signature.

Errors

The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.

concat_async

concat_async(parts: Array) -> await PackedByteArray

Dispatch byte-sequence concatenation to a CPU worker.

Parameters

NameTypeDefaultDescription
partsArrayRequiredComponents assembled by the operation, in the representation shown by the type.

Return value

await PackedByteArray

Returns a Signal. Use await to receive the completion value shown in the signature.

Errors

This call has no Err return slot. Its return type and documented sentinel values determine how to inspect the result.

equals_async

equals_async(a: PackedByteArray, b: PackedByteArray) -> await bool

Dispatch byte-sequence equality checks to a CPU worker.

Parameters

NameTypeDefaultDescription
aPackedByteArrayRequiredFirst input or comparison operand.
bPackedByteArrayRequiredSecond input or comparison operand.

Return value

await bool

Returns a Signal. Use await to receive the completion value shown in the signature.

Errors

This call has no Err return slot. Its return type and documented sentinel values determine how to inspect the result.

includes_async

includes_async(hay: PackedByteArray, needle: PackedByteArray) -> await bool

Dispatch byte-subsequence searches to a CPU worker.

Parameters

NameTypeDefaultDescription
hayPackedByteArrayRequiredByte sequence searched for the requested pattern.
needlePackedByteArrayRequiredByte pattern to find in the searched sequence.

Return value

await bool

Returns a Signal. Use await to receive the completion value shown in the signature.

Errors

This call has no Err return slot. Its return type and documented sentinel values determine how to inspect the result.

index_of_async

index_of_async(hay: PackedByteArray, needle: PackedByteArray, from: int = 0) -> await int

Dispatch first byte-subsequence searches to a CPU worker.

Parameters

NameTypeDefaultDescription
hayPackedByteArrayRequiredByte sequence searched for the requested pattern.
needlePackedByteArrayRequiredByte pattern to find in the searched sequence.
fromint0Starting point used by the operation.

Return value

await int

Returns a Signal. Use await to receive the completion value shown in the signature.

Errors

This call has no Err return slot. Its return type and documented sentinel values determine how to inspect the result.

last_index_of_async

last_index_of_async(hay: PackedByteArray, needle: PackedByteArray) -> await int

Dispatch last byte-subsequence searches to a CPU worker.

Parameters

NameTypeDefaultDescription
hayPackedByteArrayRequiredByte sequence searched for the requested pattern.
needlePackedByteArrayRequiredByte pattern to find in the searched sequence.

Return value

await int

Returns a Signal. Use await to receive the completion value shown in the signature.

Errors

This call has no Err return slot. Its return type and documented sentinel values determine how to inspect the result.

starts_with_async

starts_with_async(hay: PackedByteArray, prefix: PackedByteArray) -> await bool

Dispatch byte-prefix comparison to a CPU worker.

Parameters

NameTypeDefaultDescription
hayPackedByteArrayRequiredByte sequence searched for the requested pattern.
prefixPackedByteArrayRequiredPrefix applied when constructing the resulting names, paths or output.

Return value

await bool

Returns a Signal. Use await to receive the completion value shown in the signature.

Errors

This call has no Err return slot. Its return type and documented sentinel values determine how to inspect the result.

ends_with_async

ends_with_async(hay: PackedByteArray, suffix: PackedByteArray) -> await bool

Dispatch byte-suffix comparison to a CPU worker.

Parameters

NameTypeDefaultDescription
hayPackedByteArrayRequiredByte sequence searched for the requested pattern.
suffixPackedByteArrayRequiredSuffix to test or remove from the end of the input.

Return value

await bool

Returns a Signal. Use await to receive the completion value shown in the signature.

Errors

This call has no Err return slot. Its return type and documented sentinel values determine how to inspect the result.

repeat_async

repeat_async(src: PackedByteArray, times: int) -> await PackedByteArray

Dispatch byte repetition to a CPU worker.

Parameters

NameTypeDefaultDescription
srcPackedByteArrayRequiredSource input to read or transform; file operations interpret it as a source path.
timesintRequiredNumber of repetitions of the input sequence.

Return value

await PackedByteArray

Returns a Signal. Use await to receive the completion value shown in the signature.

Errors

This call has no Err return slot. Its return type and documented sentinel values determine how to inspect the result.

fit_async

fit_async(src: PackedByteArray, size: int) -> await PackedByteArray

Dispatch byte-sequence resizing to a CPU worker.

Parameters

NameTypeDefaultDescription
srcPackedByteArrayRequiredSource input to read or transform; file operations interpret it as a source path.
sizeintRequiredRequested output length in bytes.

Return value

await PackedByteArray

Returns a Signal. Use await to receive the completion value shown in the signature.

Errors

This call has no Err return slot. Its return type and documented sentinel values determine how to inspect the result.

split_async

split_async(src: PackedByteArray, sep: PackedByteArray) -> await Array

Dispatch byte-sequence splitting to a CPU worker.

Parameters

NameTypeDefaultDescription
srcPackedByteArrayRequiredSource input to read or transform; file operations interpret it as a source path.
sepPackedByteArrayRequiredSeparator used to split or join records or fields.

Return value

await Array

Returns a Signal. Use await to receive the completion value shown in the signature.

Errors

This call has no Err return slot. Its return type and documented sentinel values determine how to inspect the result.

xor_bytes_async

xor_bytes_async(a: PackedByteArray, b: PackedByteArray) -> await PackedByteArray

Dispatch bytewise exclusive OR to a CPU worker.

Parameters

NameTypeDefaultDescription
aPackedByteArrayRequiredFirst input or comparison operand.
bPackedByteArrayRequiredSecond input or comparison operand.

Return value

await PackedByteArray

Returns a Signal. Use await to receive the completion value shown in the signature.

Errors

This call has no Err return slot. Its return type and documented sentinel values determine how to inspect the result.

equal_ct_async

equal_ct_async(a: PackedByteArray, b: PackedByteArray) -> await bool

Dispatch constant-time comparison to a CPU worker.

Parameters

NameTypeDefaultDescription
aPackedByteArrayRequiredFirst input or comparison operand.
bPackedByteArrayRequiredSecond input or comparison operand.

Return value

await bool

Returns a Signal. Use await to receive the completion value shown in the signature.

Errors

This call has no Err return slot. Its return type and documented sentinel values determine how to inspect the result.

csv_async

csv_async(src: String, sep: String = ",") -> await Array, Err

Dispatch in-memory format conversion to CPU workers.

Parameters

NameTypeDefaultDescription
srcStringRequiredSource input to read or transform; file operations interpret it as a source path.
sepString","Separator used to split or join records or fields.

Return value

await Array, Err

Returns a Signal. Use await to receive the completion value shown in the signature.

Errors

The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.

to_csv_async

to_csv_async(rows: Array, sep: String = ",") -> await String

Dispatch CSV encoding to a CPU worker.

Parameters

NameTypeDefaultDescription
rowsArrayRequiredRows in input order. Batch database calls use one parameter set per row.
sepString","Separator used to split or join records or fields.

Return value

await String

Returns a Signal. Use await to receive the completion value shown in the signature.

Errors

This call has no Err return slot. Its return type and documented sentinel values determine how to inspect the result.

csv_objects_async

csv_objects_async(src: String, sep: String = ",") -> await Array, Err

Dispatch object CSV parsing to a CPU worker.

Parameters

NameTypeDefaultDescription
srcStringRequiredSource input to read or transform; file operations interpret it as a source path.
sepString","Separator used to split or join records or fields.

Return value

await Array, Err

Returns a Signal. Use await to receive the completion value shown in the signature.

Errors

The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.

to_csv_objects_async

to_csv_objects_async(items: Array, sep: String = ",") -> await String

Dispatch object CSV encoding to a CPU worker.

Parameters

NameTypeDefaultDescription
itemsArrayRequiredInput elements to transform or collect, in their supplied order.
sepString","Separator used to split or join records or fields.

Return value

await String

Returns a Signal. Use await to receive the completion value shown in the signature.

Errors

This call has no Err return slot. Its return type and documented sentinel values determine how to inspect the result.

ini_async

ini_async(src: String) -> await Dictionary, Err

Dispatch INI parsing to a CPU worker.

Parameters

NameTypeDefaultDescription
srcStringRequiredSource input to read or transform; file operations interpret it as a source path.

Return value

await Dictionary, Err

Returns a Signal. Use await to receive the completion value shown in the signature.

Errors

The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.

to_ini_async

to_ini_async(data: Dictionary) -> await String

Dispatch INI encoding to a CPU worker.

Parameters

NameTypeDefaultDescription
dataDictionaryRequiredInput data in the representation shown by the parameter type.

Return value

await String

Returns a Signal. Use await to receive the completion value shown in the signature.

Errors

This call has no Err return slot. Its return type and documented sentinel values determine how to inspect the result.

toml_async

toml_async(src: String) -> await Dictionary, Err

Dispatch TOML parsing to a CPU worker.

Parameters

NameTypeDefaultDescription
srcStringRequiredSource input to read or transform; file operations interpret it as a source path.

Return value

await Dictionary, Err

Returns a Signal. Use await to receive the completion value shown in the signature.

Errors

The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.

to_toml_async

to_toml_async(data: Dictionary, prefix: String = "") -> await String, Err

Dispatch TOML encoding to a CPU worker.

Parameters

NameTypeDefaultDescription
dataDictionaryRequiredInput data in the representation shown by the parameter type.
prefixString""Table path prefix prepended to encoded tables.

Return value

await String, Err

Returns a Signal. Use await to receive the completion value shown in the signature.

Errors

The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.

yaml_async

yaml_async(src: String) -> await Variant, Err

Dispatch YAML parsing to a CPU worker.

Parameters

NameTypeDefaultDescription
srcStringRequiredSource input to read or transform; file operations interpret it as a source path.

Return value

await Variant, Err

Returns a Signal. Use await to receive the completion value shown in the signature.

Errors

The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.

to_yaml_async

to_yaml_async(data: Variant, depth: int = 0) -> await String, Err

Dispatch YAML encoding to a CPU worker.

Parameters

NameTypeDefaultDescription
dataVariantRequiredInput data in the representation shown by the parameter type.
depthint0Initial nesting or indentation depth for serialization.

Return value

await String, Err

Returns a Signal. Use await to receive the completion value shown in the signature.

Errors

The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.

jsonc_async

jsonc_async(src: String) -> await Variant, Err

Dispatch commented JSON parsing to a CPU worker.

Parameters

NameTypeDefaultDescription
srcStringRequiredSource input to read or transform; file operations interpret it as a source path.

Return value

await Variant, Err

Returns a Signal. Use await to receive the completion value shown in the signature.

Errors

The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.

strip_jsonc_async

strip_jsonc_async(src: String) -> await String

Dispatch JSON comment stripping to a CPU worker.

Parameters

NameTypeDefaultDescription
srcStringRequiredSource input to read or transform; file operations interpret it as a source path.

Return value

await String

Returns a Signal. Use await to receive the completion value shown in the signature.

Errors

This call has no Err return slot. Its return type and documented sentinel values determine how to inspect the result.

jsonl_async

jsonl_async(src: String) -> await Array, Err

Dispatch JSON Lines parsing to a CPU worker.

Parameters

NameTypeDefaultDescription
srcStringRequiredSource input to read or transform; file operations interpret it as a source path.

Return value

await Array, Err

Returns a Signal. Use await to receive the completion value shown in the signature.

Errors

The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.

to_jsonl_async

to_jsonl_async(items: Array) -> await String, Err

Dispatch JSON Lines encoding to a CPU worker.

Parameters

NameTypeDefaultDescription
itemsArrayRequiredInput elements to transform or collect, in their supplied order.

Return value

await String, Err

Returns a Signal. Use await to receive the completion value shown in the signature.

Errors

The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.

front_matter_async

front_matter_async(src: String) -> await Dictionary, Err

Dispatch front-matter parsing to a CPU worker.

Parameters

NameTypeDefaultDescription
srcStringRequiredSource input to read or transform; file operations interpret it as a source path.

Return value

await Dictionary, Err

Returns a Signal. Use await to receive the completion value shown in the signature.

Errors

The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.

to_front_matter_async

to_front_matter_async(attrs: Dictionary, body: String, kind: String = "yaml") -> await String, Err

Dispatch front-matter encoding to a CPU worker.

Parameters

NameTypeDefaultDescription
attrsDictionaryRequiredNamed attributes to encode in markup or document metadata.
bodyStringRequiredContent to write or include in the response.
kindString"yaml"Metadata format: yaml, toml or json.

Return value

await String, Err

Returns a Signal. Use await to receive the completion value shown in the signature.

Errors

The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.

xml_async

xml_async(src: String) -> await Dictionary, Err

Dispatch XML parsing to a CPU worker.

Parameters

NameTypeDefaultDescription
srcStringRequiredSource input to read or transform; file operations interpret it as a source path.

Return value

await Dictionary, Err

Returns a Signal. Use await to receive the completion value shown in the signature.

Errors

The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.

to_xml_async

to_xml_async(data: Dictionary, indent: int = 0) -> await String, Err

Dispatch XML encoding to a CPU worker.

Parameters

NameTypeDefaultDescription
dataDictionaryRequiredInput data in the representation shown by the parameter type.
indentint0Number of spaces per indentation level.

Return value

await String, Err

Returns a Signal. Use await to receive the completion value shown in the signature.

Errors

The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.

env_async

env_async(src: String) -> await Dictionary, Err

Dispatch dotenv parsing to a CPU worker.

Parameters

NameTypeDefaultDescription
srcStringRequiredSource input to read or transform; file operations interpret it as a source path.

Return value

await Dictionary, Err

Returns a Signal. Use await to receive the completion value shown in the signature.

Errors

The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.

to_env_async

to_env_async(data: Dictionary) -> await String, Err

Dispatch dotenv encoding to a CPU worker.

Parameters

NameTypeDefaultDescription
dataDictionaryRequiredInput data in the representation shown by the parameter type.

Return value

await String, Err

Returns a Signal. Use await to receive the completion value shown in the signature.

Errors

The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.

tar_async

tar_async(entries: Array) -> await PackedByteArray, Err

Dispatch tar encoding to a CPU worker.

Parameters

NameTypeDefaultDescription
entriesArrayRequiredArchive entries containing their names and content.

Return value

await PackedByteArray, Err

Returns a Signal. Use await to receive the completion value shown in the signature.

Errors

The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.

untar_async

untar_async(data: PackedByteArray) -> await Array, Err

Dispatch tar decoding to a CPU worker.

Parameters

NameTypeDefaultDescription
dataPackedByteArrayRequiredInput data in the representation shown by the parameter type.

Return value

await Array, Err

Returns a Signal. Use await to receive the completion value shown in the signature.

Errors

The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.