1.0.0 • Published 2 years ago

xdbfoundation-identicon-js v1.0.0

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

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:

image

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.