Deterministic avatars for JavaScript, Kotlin, and Rust

A name in, a face out.
Three styles, every language.

Peek turns any name into an avatar, computed from the name itself. Nothing is stored and nothing is fetched, so the face is the same one every time, everywhere. New in 2.0.0: every face can be drawn three ways, peek, haze, or bloc, and dressed with glasses, a bow, a cap, a sprout, or a tie.

3
runtimes
3
drawing styles
667
golden vectors
0
dependencies

01

One family, three runtimes

Pick the language you ship in. The faces stay the same, and every port is now at version 2.0.0, matching the original Peek 2.0.0 from Doan Labs.

peek-vanilla

JavaScript

The reference port. Zero dependencies, no React, no build step. Static SVG strings, or mount a face with the full live animation rig: springs, blinks, saccades, gaze. Now with all three drawing styles and the full wardrobe.

npm i @sakayori/[email protected]
Sakayorii/peek-vanilla

peek-kotlin

Kotlin

For the JVM and Android. Drop it into Jetpack Compose, or render SVG strings on a server. Verified byte-identical to the reference across 667 golden vectors, styles and outfits included.

com.github.Sakayorii:peek-kotlin:v2.0.0
Sakayorii/peek-kotlin

peek-rust

Rust

For CLIs, servers, and WASM. Same hash, same seed, same drawing code, compiled down to nothing. Crate version 2.0.0, taken straight from the v2.0.0 tag. One deliberate difference: lone surrogates become U+FFFD, per TextEncoder semantics.

sakayori-peek = { git = ".../peek-rust", tag = "v2.0.0" }
Sakayorii/peek-rust

02

One face, three ways to draw it

Type a name, pick an expression and an outfit, and see the same identity drawn as peek, haze, and bloc. A style never changes who the face is. Every face below is rendered live by the JavaScript port running on this page.

Select a card to feature that style. The call that draws the featured face is:

03

Same name. Same face. Everywhere.

Each face is computed from the name with FNV-1a and mulberry32. There is no database and no network call, so identity is portable by construction.

  • 667 golden vectors. Curated names with unicode, emoji, and whitespace edge cases, every expression, every part override, every accessory slot and combination, and all three drawing styles. One byte off fails.
  • 20,160 distinct faces. Four face shapes, seven colors, three eyes, four brows, four mouths, three cheeks, and five traits combine into 20,160 identities, before expressions, outfits, and styles multiply them further.
  • 1,800 animation poses. The Kotlin-side animation rig was stepped pose-for-pose against the JavaScript harness. Worst drift: 1.4e-15.
  • Zero dependencies. Every port ships with no runtime dependencies, in every language.

Each face above is rendered live from its language name. Same name in, same face out, in every runtime. The Kotlin and Rust ports produce byte-identical SVG for the same input, checked by 667 golden vectors.

04

Three calls, one face

A string in, a face out. The shape of the call barely changes between languages, and the style and outfit options travel with it.

import { toSvg, mount } from '@sakayori/peek-vanilla';

// a string of SVG, anywhere JavaScript runs
const svg = toSvg('Sakayori');

// dress it up, or draw it another way
const dressed = toSvg('Sakayori', { eyewear: 'glasses', headwear: 'sprout' });
const bloc = toSvg('Sakayori', { variant: 'bloc' });

// or a live face, animated, in the DOM
mount('Sakayori', '#avatar', { animate: true });
// repositories { maven("https://jitpack.io") }
// implementation("com.github.Sakayorii:peek-kotlin:v2.0.0")

val svg: String = toSvg("Sakayori")
val dressed: String = toSvg(
  "Sakayori",
  PeekOptions(eyewear = "glasses", variant = "haze")
)
# sakayori-peek = { git = "https://github.com/Sakayorii/peek-rust", tag = "v2.0.0" }

use sakayori_peek::{to_svg, PeekOptions};

let svg = to_svg("Sakayori", &PeekOptions::default());
let haze = to_svg("Sakayori", &PeekOptions {
    variant: Some("haze".to_string()),
    ..PeekOptions::default()
});

Credit

Peek began at Doan Labs.

The original Peek, the algorithm, the drawing code, and the design belong to Doan Labs. This family ports their work to new languages with the same care, keeping the MIT license intact, and now tracks the original at version 2.0.0. Thank you for making something worth porting.

Visit the original