GitHub's identicon algorithm written in JS, crudely ported from https://github.com/dgraham/identicon
npm install github-identicon
import { writeFileSync } from "node:fs";
import { identicon } from "github-identicon";
let id = Math.floor(Math.random() * 283045200);
const icon = identicon(id, 500).buffer;
writeFileSync(`${id}.png`, icon);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.