Skip to content
Konjure / spatial intelligence

bytes

← Builtin reference

Builds immutable bytes from checked unsigned 8-bit values.

Signature

func bytes(values: List[u8]) -> Bin

Each element is a u8, so out-of-range literal bytes are compile errors. The Bin owns shared immutable storage and has no text encoding until decoded explicitly.

Parameters

values: List[u8]
Unsigned 8-bit values; list literals inherit u8.

Returns

Bin

Immutable packed bytes.

Examples

Builds immutable bytes from checked unsigned 8-bit values

Run the example, then change the data and inspect the result.

Tick 0 · 0.00 s⌘ / Ctrl + EnterThis device
main.kj
Loading the language runtime…
Output 0
No output.
Expected output
AB

Rust definition

Rust SDK data primitives; the language checker specializes the same runtime operation.

See also