glorpies

faq

Determinism, collisions, size, SSR, licence and source.

is it really the same face everywhere?

Yes. A name always hashes to the same seed, and every decision is derived from the seed with plain arithmetic, no platform APIs, so the face's geometry and colours are identical in every browser, on every server and in every version. Tests pin the faces of known names; a release that changed one would be a major version.

Pixels are a different matter:

  • Each canvas implementation anti-aliases and composites differently, so Chrome, Safari and Skia on a server differ at the soft edges of strokes.
  • Math.sin and friends can differ in the last bit between arm64 and x64, which moves a coordinate by under a millionth of a pixel. Face fingerprints round to 1e-6 to absorb this.

Within one renderer on one platform, output is byte-identical, and the tests pin pixels per platform.

how many faces are there? can two names share one?

253 = 9,007,199,254,740,992, one per seed. Collisions follow the birthday bound: among a million names, the chance that any two share a face is about 1 in 18,000.

can someone choose their own face?

Not by name, since a name maps to exactly one face. To offer a choice, show a few candidates (from randomName(), or random seeds) and store the one picked. name also accepts a seed number directly.

how heavy is it?

No runtime dependencies. The CDN script is 41 kB gzipped, and the npm entries share chunks, so you bundle the renderer once. Faces paint when they near the viewport, share one requestAnimationFrame loop, and stop animating off screen or in a hidden tab.

which frameworks does it work with?

Components for React, Vue, Svelte, Solid and Preact. Anything else that renders HTML, including Angular and Astro, uses the <glorpie-face> element. The image route runs on anything with fetch-style Request/Response (Next.js, SvelteKit, Nuxt, Astro, Hono, Bun, Deno) or node:http (Express).

does it work with server rendering?

Yes. Components render a placeholder in the face's background colour at its final size and shape, then paint after hydration. Where no script runs, as in email, use an image from your own route.

can I use it commercially?

Yes. glorpies is MIT licensed. No attribution is required in your UI; the licence notice ships with the package.

where's the source?

On GitHub, MIT licensed. Issues and pull requests are welcome; read the contributing guide first. Report security issues privately, not as issues.