cyber-circle-identicon
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

Cyber Circle Identicons

Examples

Despite 1 letter being different, the entire image is different.

Example 1 Cyber Circle

Cyber Circle

Example 2 Cyber Circle

Cyber_Circle

Example 3 Cyber Circle

Cyber-Circle

Example 4 Cyber Circle

Cyber circle

Example 5 Cyber Circle

cyber Circle

Example 6 Cyber Circle

cyber circle

Usage

npm install cyber-circle-identicon

Download on Node.js

import { createIdenticon } from 'cyber-circle-identicon';
import { writeFileSync } from 'fs';

const userIdenticon = createIdenticon('Hello World!');
writeFileSync('identicon.png', userIdenticon);

As a React <img> source

import { createIdenticon } from 'cyber-circle-identicon'

const ReactComponent = () => {
	const userIdenticon = createIdenticon('Hello World!');

	return (
		<img src={'data:image/png;base64,' + cyberCirclePNG.toString('base64')} />
	);
};

Documentation

CreateIdenticon

Returns a PNG buffer of a cyber circle generated from a string.

key: string - The key to generate the PNG from. For example, this is someone's username.

additionalOptions: object - An object of options for greater customization.

  • size: number - The size of the image.
  • clipped: boolean - Whether the image should be clipped to a circle, this should be false if your platform typically clips images to a circle.
  • compression: number - The compression level of the image, this corresponds with zlib compression.
  • smoothEdges: number - how much to smooth the edges of each element. This is synonymous to adding anti-aliasing.
  • overrideData: object - Overrides the default data, this is great for platforms with themes.

Contribute

Any contribution is greatly appreciated. Feel free to fork the repository and submit a pull request.

I will actively review all issues and pull requests.

Contributors

Kyle Smith contributor cyber circle

KyleSmith0905

Owner

Package Sidebar

Install

npm i cyber-circle-identicon

Weekly Downloads

1

Version

1.0.1

License

MIT

Unpacked Size

29.7 kB

Total Files

29

Last publish

Collaborators

  • kylesmith0905