glyphatar
Deterministic SVG identicons ("glyph avatars") built from simple shapes. I didn't like any similar existing libraries.
This is a first version created with Claude. If it sees any kind of usage I will revisit with a human eye. No dependencies (except for the test, to confirm the SHA256 implementation.)
Live demo: try it with your own text or bytes.
// Any bytes: a public key, a user id, an email hash…
let svg: String = svg;
// With a <title> for screen readers and hover tooltips:
let svg = new.to_svg_with_title;
- The input is hashed with SHA-256, so it can be any length.
- The output is a small SVG with one
<path>per colour, a transparent background and hex colours, so it renders anywhere. - Stable output: the same input renders the same glyph within a major
version. Any visual change is a breaking release.
- Note: pre-1.0, I'll probably make some breaking changes - contact me if you want to use this seriously before that :)
To browse random glyphs, run cargo run --example serve and open
http://localhost:3001. Refresh for new ones.
License
MIT
Development
Publish
- Bump Cargo.toml version
-
- Commit
-
Live Demo