A tiny library for generating blocky identicons as base64 encoded PNGs.
See a live demo of it in action
# NPM
npm install --save ethereum-blockies-base64
# Yarn
yarn add ethereum-blockies-base64
import makeBlockie from 'ethereum-blockies-base64';
const img = new Image() ;
img.src = makeBlockie('0x7cB57B5A97eAbe94205C07890BE4c1aD31E486A8');
document.body.appendChild(img);
import React from 'react';
import makeBlockie from 'ethereum-blockies-base64';
class Blockie extends React.Component {
render() {
return <img src={makeBlockie(this.props.address)}/>
}
}
Note: In a real setting, we recommend saving to state and re-making the blockie on prop change for better re-render performance.