Getting Started¶
This tutorial walks you through installing iscc-lib, generating your first ISCC code, and understanding the result. By the end, you will know how to create content identifiers for metadata, text, and binary data.
Prerequisites¶
You need a working development environment for your language of choice. iscc-lib supports Python 3.10+, Rust, Node.js, Java 17+, Go 1.21+, and WebAssembly.
Install¶
Verify the installation by running the built-in conformance self-test:
If this prints true, the library is installed correctly and passes all official ISO 24138 test
vectors.
Generate your first ISCC code¶
The simplest way to create an ISCC is from content metadata. Use gen_meta_code_v0 with a title and
optional description:
JSON serialization (Python)
The Python result object supports both attribute access (result.iscc) and dict-style access
(result["iscc"]). It is also JSON-serializable:
Understand the ISCC structure¶
Every ISCC code encodes its type, subtype, version, and length in a self-describing header. Use
iscc_decompose to inspect the components of a composite code:
Each ISCC-UNIT header encodes:
- MainType — the kind of code (META, TEXT, IMAGE, AUDIO, VIDEO, MIXED, DATA, INSTANCE, ISCC)
- SubType — content type qualifier (e.g., TEXT, IMAGE, NONE)
- Version — algorithm version (currently V0 for all types)
- Length — bit length of the body (default 64 bits)
Try other code types¶
ISCC supports different code types for different content. Here are two more examples.
Text-Code¶
Generate a similarity hash from text content:
Text-Codes capture the semantic fingerprint of text. Similar texts produce similar codes, enabling fuzzy matching.
Instance-Code¶
Generate an exact identity hash from raw bytes:
For large files, use InstanceHasher to process data in chunks without loading everything into
memory:
long ptr = IsccLib.instanceHasherNew();
try {
var fis = new java.io.FileInputStream("large_file.bin");
byte[] buf = new byte[65536];
int n;
while ((n = fis.read(buf)) != -1) {
IsccLib.instanceHasherUpdate(ptr, java.util.Arrays.copyOf(buf, n));
}
System.out.println(IsccLib.instanceHasherFinalize(ptr, 64));
} finally {
IsccLib.instanceHasherFree(ptr);
}
import init, {
InstanceHasher
} from "@iscc/wasm";
// Browsers and bundlers; for Node.js see the WASM how-to (initSync)
await init();
const hasher = new InstanceHasher();
// Feed Uint8Array chunks from a ReadableStream or File
hasher.update(new Uint8Array([72, 101, 108, 108, 111]));
hasher.update(new Uint8Array([32, 87, 111, 114, 108, 100]));
console.log(hasher.finalize());
Next steps¶
Now that you have generated your first ISCC codes, explore further:
- Python how-to guide — all 10 code types, structured results, streaming, and text utilities
- Rust how-to guide — Rust-level API with typed results and ownership
- Node.js how-to guide — use iscc-lib from JavaScript
- Java how-to guide — JNI bindings for Java applications
- Go how-to guide — pure Go implementation
- WebAssembly how-to guide — run ISCC in the browser
- Architecture — understand the hub-and-spoke crate model and internal design
- Python API reference — complete function signatures and docstrings
- Rust API reference — Rust-level API documentation