Skip to content

Latest commit

 

History

History
23 lines (17 loc) · 739 Bytes

File metadata and controls

23 lines (17 loc) · 739 Bytes

github-identicon

GitHub's identicon algorithm written in JS, crudely ported from https://github.com/dgraham/identicon

identicon

Install

npm install github-identicon

Usage

import { writeFileSync } from "node:fs";
import identicon from "github-identicon";

let id = Math.floor(Math.random() * 221110555);

const icon = identicon(id, 500);
writeFileSync(`${id}.png`, icon);

Notes

GitHub's identicons are taken from the ID of the account, not the username of it. Technically you can use anything other than a number, but it has no real value.