visual_hashing/lib.rs
1// SPDX-FileCopyrightText: 2026 Blackcat Informatics® Inc. <paudley@blackcatinformatics.ca>
2// SPDX-License-Identifier: MIT OR Apache-2.0
3
4//! Human-friendly **visual fingerprints** for keys, checksums, and any byte
5//! string you need a human to compare out-of-band.
6//!
7//! Two complementary renderings, both pure functions of the input bytes:
8//!
9//! - [`emojihash`] / [`emojihash_labels`] — a BLAKE3-XOF digest sliced into
10//! 6-bit symbols indexing a fixed, nameable 64-emoji alphabet. Short, glanceable,
11//! and speakable ("monkey pig apple …").
12//! - [`randomart`] — the OpenSSH-style "Drunken Bishop" ASCII-art grid you see
13//! in `ssh-keygen -lv` output.
14//!
15//! ```
16//! use visual_hashing::{emojihash, emojihash_labels, randomart};
17//!
18//! let key = b"\x00\x01\x02\x03";
19//! println!("{}", emojihash(key, 11)); // 🐵 🐶 … (11 emoji)
20//! println!("{}", emojihash_labels(key, 11)); // monkey dog …
21//! println!("{}", randomart(key, "ED25519")); // +--[ED25519 …
22//! ```
23//!
24//! Both renderings are byte-for-byte deterministic and gated by a frozen
25//! conformance corpus, so independent implementations agree exactly.
26
27mod emojihash;
28mod randomart;
29
30pub use emojihash::{emoji_indices, emojihash, emojihash_labels, ALPHABET_SIZE, EMOJI, LABELS};
31pub use randomart::randomart;