Skip to main content

Crate visual_hashing

Crate visual_hashing 

Source
Expand description

Human-friendly visual fingerprints for keys, checksums, and any byte string you need a human to compare out-of-band.

Two complementary renderings, both pure functions of the input bytes:

  • emojihash / emojihash_labels — a BLAKE3-XOF digest sliced into 6-bit symbols indexing a fixed, nameable 64-emoji alphabet. Short, glanceable, and speakable (“monkey pig apple …”).
  • randomart — the OpenSSH-style “Drunken Bishop” ASCII-art grid you see in ssh-keygen -lv output.
use visual_hashing::{emojihash, emojihash_labels, randomart};

let key = b"\x00\x01\x02\x03";
println!("{}", emojihash(key, 11));        // 🐵 🐶 … (11 emoji)
println!("{}", emojihash_labels(key, 11)); // monkey dog …
println!("{}", randomart(key, "ED25519")); // +--[ED25519 …

Both renderings are byte-for-byte deterministic and gated by a frozen conformance corpus, so independent implementations agree exactly.

Constants§

ALPHABET_SIZE
The number of distinct emoji digits (a 6-bit alphabet).
EMOJI
The 64-entry emoji alphabet (a 6-bit digit set).
LABELS
The stable label for each entry in EMOJI, by index.

Functions§

emoji_indices
Return length 6-bit digest symbols (each in 0..64).
emojihash
Map data to a space-joined string of length emoji digits.
emojihash_labels
The stable label names for emojihash output (space-joined).
randomart
Render an OpenSSH-style randomart fingerprint of data.