Skip to main content

Crate token_terminator

Crate token_terminator 

Source
Expand description

Rust interoperability helpers for Token Terminator.

The production Token Terminator runtime remains the Python/Hermes implementation. This crate intentionally exposes only stable cross-language primitives that Rust agent adapters can use without embedding Python: content-addressed artifact identities, digest verification, and the strict character-reduction invariant.

It is not a PyO3 accelerator and does not implement the SQLite vault, request compiler, tokenizer adapters, or Hermes lifecycle hooks.

Structs§

ArtifactIdentity
A content identity compatible with Token Terminator’s Python artifact vault.
InvalidSha256
Error returned when a caller supplies something that is not a SHA-256 hex digest.

Constants§

SHORT_ARTIFACT_HEX_LEN
Number of hexadecimal SHA-256 characters used by Token Terminator’s normal short artifact identifier.

Functions§

artifact_id_from_sha256
Build Token Terminator’s normal short artifact ID from a full SHA-256 digest.
artifact_id_matches
Return whether an artifact ID is compatible with the supplied UTF-8 text.
artifact_identity
Compute the normal Token Terminator identity for UTF-8 text.
full_artifact_id_from_sha256
Build Token Terminator’s full collision-fallback artifact ID from a digest.
sha256_hex
Return the lowercase SHA-256 digest of arbitrary bytes.
strictly_smaller_chars
Mirror Token Terminator’s character-based strict-reduction invariant.
verify_sha256
Verify that UTF-8 text has the expected SHA-256 digest.