@raugfer/jazzicon
TypeScript icon, indicating that this package has built-in type declarations

1.0.6 • Public • Published

Jazzicon SVG Generator

A simple Jazzicon SVG Generator for Ethereum addresses.

Installation

npm i @raugfer/jazzicon

Usage

import Jazzicon from '@raugfer/jazzicon';

// builds an image data url for embedding
function buildDataUrl(address: string): string {
  return 'data:image/svg+xml;base64,' + btoa(Jazzicon(address));
}

// sample code for react component
export default function JazziconImage({ address }: { address: string }) {
  const imageUrl = buildDataUrl(address);
  return (
    <img src={imageUrl} alt="Jazzicon" />
  );
}

Package Sidebar

Install

npm i @raugfer/jazzicon

Weekly Downloads

298

Version

1.0.6

License

MIT

Unpacked Size

10.2 kB

Total Files

7

Last publish

Collaborators

  • raugfer