Skip to main content

Module codec

Module codec 

Source
Expand description

ISCC codec: type enums, header encoding/decoding, base32, and component encoding.

Provides the foundational encoding primitives that all gen_*_v0 functions depend on to produce ISCC-encoded output strings. This is a Tier 2 module — available to Rust consumers but not exposed through FFI bindings.

Enums§

MainType
ISCC MainType identifier.
SubType
ISCC SubType identifier.
Version
ISCC version identifier.

Functions§

decode_base32
Decode base32 string to bytes (case-insensitive, no padding expected).
decode_header
Decode ISCC header from bytes.
decode_length
Decode header length field to actual bit length.
decode_units
Decode a unit combination index (0–7) to a sorted list of optional MainTypes.
encode_base32
Encode bytes as base32 (RFC 4648, uppercase, no padding).
encode_base64
Encode bytes as base64url (RFC 4648 §5, no padding).
encode_component
Encode an ISCC-UNIT with header and body as a base32 string.
encode_header
Encode ISCC header fields into bytes.
encode_length
Encode bit length to header length field value.
encode_units
Encode optional ISCC-UNIT MainTypes as a unit combination index (0–7).
iscc_decompose
Decompose a composite ISCC-CODE or ISCC sequence into individual ISCC-UNITs.