Identeapots is a simple TypeScript library for generating identicon images.
npm i @teapotlabs/identeapots
The return value of the generateIdenteapot
function is Data URL
import { generateIdenteapot } from "@teapotlabs/identeapots";
// data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAACPEAAAH0C...
const identicon: string = generateIdenteapot("hello world", "salt");
Which can be used in <img>
tags as src
attribute.
<img src={identicon} alt="Example Identeapot" />
This will generate the following image:
A complete example of a NextJS application is available in the /test
folder
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.