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 cdc::alg_cdc_chunks;
pub use codec::encode_base64;
pub use codec::iscc_decompose;
pub use conformance::conformance_selftest;
pub use minhash::alg_minhash_256;
pub use simhash::alg_simhash;
pub use simhash::sliding_window;
pub use streaming::DataHasher;
pub use streaming::InstanceHasher;
pub use utils::text_clean;
pub use utils::text_collapse;
pub use utils::text_remove_newlines;
pub use utils::text_trim;
pub use types::*;

Modules§

cdc
Content-Defined Chunking (CDC) for similarity-preserving data splitting.
codec
ISCC codec: type enums, header encoding/decoding, base32, and component encoding.
conformance
Conformance selftest for ISO 24138:2024 (ISCC).
minhash
MinHash algorithm for similarity-preserving hashing.
simhash
SimHash algorithm and sliding window utilities.
streaming
Streaming hash types for incremental ISCC code generation.
types
Structured result types for ISCC code generation functions.
utils
Text normalization and hashing utilities for ISCC code generation.

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§

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.
soft_hash_video_v0
Compute a similarity-preserving hash from video frame signatures.

Type Aliases§

IsccResult
Result type alias for ISCC operations.