Bytes
Bytes module: raw byte manipulation.
Bytes wraps a List(Int) of byte values in the range 0–255. March strings are UTF-8 byte sequences; Bytes exposes the raw bytes. All encoding functions (hex, base64) are implemented in pure March.
This module is self-contained: it does not depend on List. or String. being loaded, so it can be tested or used in isolation.
Types
Functions
Concatenate two Bytes values.
Decode a Base64 string to Bytes. Returns Err on invalid input.
Decode UTF-8 bytes to a String. Returns Ok(s) always (same as to_string).
Encode Bytes as a Base64 string (with padding).
Encode a String as UTF-8 bytes. Equivalent to from_string for March strings.
Parse a hex string to Bytes. Returns Err if the input is not valid hex.
Convert a String to Bytes (raw UTF-8 byte values, each 0–255).
Byte at position i (0-based). Panics if out of bounds.
True if the Bytes is empty.
Number of bytes.
Sub-slice: bytes from position start with given length.
Encode Bytes as a lowercase hexadecimal string.
Unwrap Bytes to the underlying List(Int).
Convert Bytes back to a String (bytes interpreted as UTF-8).