Skip to content

React component featuring a selection of different identicon styles

Notifications You must be signed in to change notification settings

robbiecarlton/react-identicon-variety-pack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

React Identicon Variety Pack! is a react component that displays one of a selection of different identicons. It's useful for turning hard to read computer data (like a cryptographic key) into a form that's easily recognizable for humans. Here's an overview of the subject.

Live demo

Here's a live demo for you to play with.

Installation

yarn add react-identicon-variety-pack

Usage

import { Network as Identicon } from 'react-identicon-variety-pack'

<Identicon
  size={64}
  seed={'yourpublickeyorhash'}
/>

Available styles

These are the component names, so you can eg import { Blockies } from 'react-identicon-variety-pack'.

Network

Network style identicons

Bishop

Based on the algorithm used for ssh visual keys. Bishop style identicons

Rings

Rings style identicons

Blockies

Based on this library. Blockies style identicons

Network Large

Network Large style identicons

Discs

Discs style identicons

Props

seed

random seed that generates the image.

size

size in pixels

gridSize

number of rows and columns in grid (only relevant for Blockies and Bishop).

scale

size of each gird cell in pixes (only relevant for Blockies and Bishop).

A note about security

With the (qualified) exception of Bishop*, these algorithms have not been studied for how well behaved they are as hashing functions, with regard to the three properties of preimage resistance, 2nd-preimage resistance and collision resistance. This means I can make no gaurantees about how easy it would be to spoof one of these by finding a seed that generates an image sufficiently close to a desired image. My guess is it would be very hard with any of them, but that's not backed by research. So if you are using these as part of a security protocol, you will have to satisfy yourself that they meet your requirements.

* "Qualified" because while Bishop has been studied, it was the ascii art version that was studied. The version presented here is a pixel art version and has very different visual properties.

More discussion here.

About

React component featuring a selection of different identicon styles

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published