glyphatar
Deterministic SVG identicons built from simple shapes. Same bytes in, same picture out. This page runs the npm package: the Rust crate compiled to WebAssembly. GitHub · crates.io · npm · docs.rs
Random 32-byte keys
Rust
JavaScript
SVG
Install
Same glyphs from both: the npm package is the crate compiled to WebAssembly.Rust
cargo add glyphatar
// Any bytes: a public key, a user id, an email hash… let svg: String = glyphatar::svg(b"some public key bytes", 64); // With a <title> for screen readers and hover tooltips: let svg = glyphatar::Glyphatar::new(b"alice").to_svg_with_title(64, "alice");
JavaScript
npm install glyphatar
import { svg } from "glyphatar";
// Any bytes: a string (UTF-8 encoded), Uint8Array, ArrayBuffer…
const markup = svg("some public key", 64);
// With a <title> for screen readers and hover tooltips:
svg("alice", 64, { title: "alice" });