Skip to main content

Crate iscc_lib

Crate iscc_lib 

Source
Expand description

High-performance Rust implementation of ISO 24138:2024 (ISCC).

This crate provides the core ISCC algorithm implementations. All 10 gen_*_v0 functions are the public Tier 1 API surface, designed to be compatible with the iscc-core Python reference implementation.

Re-exports§

pub use codec::encode_base64;
pub use codec::iscc_decompose;
pub use streaming::DataHasher;
pub use streaming::InstanceHasher;
pub use types::*;

Modules§

codec
ISCC codec: type enums, header encoding/decoding, base32, and component encoding.
streaming
Streaming hash types for incremental ISCC code generation.
types
Structured result types for ISCC code generation functions.

Enums§

IsccError
Error type for ISCC operations.

Constants§

IO_READ_SIZE
Buffer size in bytes for streaming file reads (4 MB).
META_TRIM_DESCRIPTION
Max UTF-8 byte length for description metadata trimming.
META_TRIM_META
Max decoded payload size in bytes for the meta element.
META_TRIM_NAME
Max UTF-8 byte length for name metadata trimming.
TEXT_NGRAM_SIZE
Character n-gram width for text content features.

Functions§

alg_cdc_chunks
Split data into content-defined chunks.
alg_minhash_256
Compute a 256-bit MinHash digest from 32-bit integer features.
alg_simhash
Compute a SimHash from a sequence of equal-length hash digests.
conformance_selftest
Run conformance tests against vendored test vectors.
encode_component
Encode a raw digest into an ISCC unit string.
gen_audio_code_v0
Generate an Audio-Code from a Chromaprint feature vector.
gen_data_code_v0
Generate a Data-Code from raw byte data.
gen_image_code_v0
Generate an Image-Code from pixel data.
gen_instance_code_v0
Generate an Instance-Code from raw byte data.
gen_iscc_code_v0
Generate a composite ISCC-CODE from individual ISCC unit codes.
gen_meta_code_v0
Generate a Meta-Code from name and optional metadata.
gen_mixed_code_v0
Generate a Mixed-Code from multiple Content-Code strings.
gen_sum_code_v0
Generate a composite ISCC-CODE from a file in a single pass.
gen_text_code_v0
Generate a Text-Code from plain text content.
gen_video_code_v0
Generate a Video-Code from frame signature data.
iscc_decode
Decode an ISCC unit string into its header components and raw digest.
json_to_data_url
Convert a JSON string into a data: URL with JCS canonicalization.
sliding_window
Generate sliding window n-grams from a string.
soft_hash_video_v0
Compute a similarity-preserving hash from video frame signatures.
text_clean
Clean and normalize text for display.
text_collapse
Normalize and simplify text for similarity hashing.
text_remove_newlines
Remove newlines and collapse whitespace to single spaces.
text_trim
Trim text so its UTF-8 encoded size does not exceed nbytes.

Type Aliases§

IsccResult
Result type alias for ISCC operations.