xdbfoundation-identicon-js
v1.0.0
Published
Tool to generate identicons for DigitalBits wallets - unique icons, generated based on the wallet public key.
Downloads
3
Readme
DigitalBits Identicon Generator (Javascript)
Tool to generate identicons for DigitalBits wallets - unique icons, generated based on the wallet public key.
Here's a set of identicons generated for random DigitalBits accounts:
With the default settings, both will produce the same identicon image for any DigitalBits account address.
Usage
import createDigitalBitsIdenticon from 'digitalbits-identicon-js';
const canvas = createDigitalBitsIdenticon('GBIDGDSVQXAHGZNOETS7ADUMWCDSQJU4R53EZRK6ONP3BA42UJL5PAHR');
const renderedIcon = canvas.toDataURL() // create data URI containing a generated icon in PNG format
Demo
- Install npm dependecies
npm install
- Build library
npm run build
And open the demo/index.html
in the browser to see the usage example.
Web API
Let's say your DigitalBits address is: GBIDGDSVQXAHGZNOETS7ADUMWCDSQJU4R53EZRK6ONP3BA42UJL5PAHR
Identicons are served as 210x210 square images in PNG format, <1KB in size, which should work for most usecases.