# 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](https://jdlunger.github.io/glyphatar/)**: try it with your own text or bytes.
```rust
// 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");
```
- 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
1. Bump Cargo.toml version
1. ```sh
cargo check
```
1. Commit
1. ```sh
git tag v1.2.3
git push origin main v1.2.3
```
### Live Demo
```sh
cd demo
cargo build --release --target wasm32-unknown-unknown
python3 -m http.server
```