Skip to main content

iscc_decode

Function iscc_decode 

Source
pub fn iscc_decode(iscc: &str) -> IsccResult<(u8, u8, u8, u8, Vec<u8>)>
Expand description

Decode an ISCC unit string into its header components and raw digest.

Inverse of encode_component. Strips an optional "ISCC:" prefix and dashes, base32-decodes the string, parses the variable-length header, and returns the digest truncated to exactly the encoded bit-length.

Returns (maintype, subtype, version, length_index, digest) where the integer fields match codec::MainType, codec::SubType, and codec::Version enum values.

ยงErrors

Returns IsccError::InvalidInput on invalid base32 input, malformed header, or if the decoded body is shorter than the expected digest length.