A small npm package that generates pretty identicons from string input.

Overview

npm

HashprintJS

HashprintJS is a small npm package written in TypeScript that generates customizable identicons.

Provide a username, wallet address, IP address or really any string you want and you'll get the Data URL of its hashprint - a pretty 7x7 bi-color image that allows you to easily distinguish and identify a piece of data.

Supports both client and server (making use of the Canvas API and node-canvas, respectively).

Installation

$ yarn add hashprintjs

Usage

const hashprint = require("hashprintjs");
const dataURL = await hashprint({ data: "hashprint", size: 40 });

You can then take the dataURL and assign it to an image src for example.

Customization

The function takes an object as argument which has the following properties:

Properties Description
data string - The data that generates the hashprint.
size? number (default: 140) - The dimensions of the hashprint, in px.
bg? string (default: "#00000000") - The background color of the hashprint, CSS color format.
saturation? number (default: 0.7) - The saturation value of the hashprint colors, from 0 to 1.
lightness? number (default: 0.5) - The lightness value of the hashprint colors, from 0 to 1.
likeness? [number, number] (default: [0.50, 0.25]) - The probability of a cell to get color 1 and color 2 respectively. From 0 to 1, the sum can't be greater than 1 (the remaining value corresponds to the probability of getting an empty cell, background).
algorithm? string (default: "SHA-256") - The algorithm used to get the hash of the data. The supported algorithms are SHA-256, SHA-384 and SHA-512.
You might also like...

A NPM package powered by Yeoman that generates a scaffolding boilerplate for back-end workflow with Node.js.

generator-noderplate Generate Node.js starter files with just one command! We have deployed a npm package that will generate a boilerplate for nodejs

Jan 24, 2022

npm i uuid, npm i nodemon, npm i commander

npm i uuid, npm i nodemon, npm i commander

goit-nodejs-hw-01 Получаем и выводим весь список контактов в виде таблицы (console.table) node index.js --action list Получаем контакт по id node inde

Jul 5, 2022

Convert some JavaScript/TypeScript code string into a .d.ts TypeScript Declaration code string

convert-to-dts Converts the source code for any .js or .ts file into the equivalent .d.ts code TypeScript would generate. Usage import { convertToDecl

Mar 3, 2022

An NPM package to help frontend developers get started with using SASS and SCSS on your project easily. The Package follows the 7-1 architecture project structure.

Project Title - Create SASS APP Ever wanted to code up a frontend project with SASS & SCSS and you are stuck with building the acclaimed 7-1 architect

Sep 22, 2022

An utility library for Encoding and Compressing whatever you give him into a small string.

🟢 ORBIT ENCODER ⚙️ 🗜️ ORBIT-ENCODER is an utility library for Data Compression and Encoding. It can take whatever object you give him as argument an

Nov 16, 2022

A package to manipulate string.

A package to manipulate string.

A package to manipulate string. Instalation use this command to installation npm install best-string imports import BestString from 'best-string' //o

Nov 17, 2022

Tag-input - A versetile tag input component built with Vue 3 Composition API

Tag-input - A versetile tag input component built with Vue 3 Composition API

TagInput A versetile tag input component built with Vue 3 Composition API. Please read this article to learn how to build this package step by step an

Oct 12, 2022

Vue-input-validator - 🛡️ Highly extensible & customizable input validator for Vue 2

Vue-input-validator - 🛡️ Highly extensible & customizable input validator for Vue 2

🛡️ Vue-input-validator demo! What is this package all about? By using this package, you can create input validators only with the help of a single di

May 26, 2022

A Bootstrap plugin to create input spinner elements for number input

A Bootstrap plugin to create input spinner elements for number input

bootstrap-input-spinner A Bootstrap / jQuery plugin to create input spinner elements for number input. Demo page with examples Examples with floating-

Nov 7, 2022

A phone input component that uses intl-tel-input for Laravel Filament

A phone input component that uses intl-tel-input for Laravel Filament

Filament Phone Input This package provides a phone input component for Laravel Filament. It uses International Telephone Input to provide a dropdown o

Nov 29, 2022

This package generates a GraphQL API from a directory of Markdown files

This package generates a GraphQL API from a directory of Markdown files. Additional metadata like tags, descriptions, or custom fields can be added to the Markdown files in the form of YAML front matter, a simple schema at the top of each file. These fields will be indexed and available to query and filter by in the GraphQL API.

Dec 29, 2022

A small javascript DOM manipulation library based on Jquery's syntax. Acts as a small utility library with the most common functions.

Quantdom JS Quantdom is a very small (about 600 bytes when ran through terser & gzipped) dom danipulation library that uuses a Jquery like syntax and

Aug 16, 2022

✏️ A small jQuery extension to turn a static HTML table into an editable one. For quickly populating a small table with JSON data, letting the user modify it with validation, and then getting JSON data back out.

jquery-editable-table A small jQuery extension to turn an HTML table editable for fast data entry and validation Demo 👉 https://jsfiddle.net/torrobin

Jul 31, 2022

Check NPM package licenses

NPM License Checker As of v17.0.0 the failOn and onlyAllow arguments take semicolons as delimeters instead of commas. Some license names contain comma

Dec 29, 2022

:eyeglasses: Node.js module that tells you when your package npm dependencies are out of date.

 :eyeglasses: Node.js module that tells you when your package npm dependencies are out of date.

Node.js module that tells you when your package npm dependencies are out of date. Getting Started Install Node.js. Install david: cd /your/project/dir

Dec 25, 2022

Open the npm page, Yarn page, or GitHub repo of a package

npm-home Open the npm page, Yarn page, or GitHub repo of a package Install $ npm install --global npm-home Usage $ npm-home --help Usage $ npm

Dec 18, 2022

Check whether a package or organization name is available on npm

npm-name Check whether a package or organization name is available on npm Install $ npm install npm-name Usage import npmName from 'npm-name'; // Ch

Nov 13, 2022

Package manager faster than NPM

Pine Script holder that runs faster than NPM and yarn Pine is a npm and yarn run like module, that allows you to organize your scripts and run them FA

Jul 10, 2021

NPM Package that simplifies Auth with Google OAuth2 🔐

NPM Package that simplifies Auth with Google OAuth2 🔐

Node Google OAuth2 🔐 A simple authentication flow for Google OAuth2 Explore the docs » Report Bug Table of Contents About The Project Getting Started

Jun 17, 2022
Comments
  • TypeScript definition should export a default function

    TypeScript definition should export a default function

    Repro:

    1. Add import hashprint from 'hashprintjs'; in a brand new Next.JS project.

    Observe TypeScript error.

    image

    If the index.d.ts file read like this:

    export default function GenerateHashprint(opts: Opts): Promise<string>;
    

    …everything would work.

    opened by steveluscher 1
Owner
Nuno David
Nuno David
Github action generates dynamic image URL for contributor list to display it!

github-action-contributors Github action generates dynamic image URL for contributor list to display it! Contributors Usage - run: mkdir -p build - na

小弟调调™ 10 Dec 31, 2022
Automatic chart generator from user input using CharGPT.

Chart GPT A platorm for generate chart with ChatGPT ??️ ChatGPT Generator is under development. Features Light/dark mode toggle Live previews Fullscre

Ehsan Ghaffar 6 May 5, 2023
A plugin for the jQuery javascript library to generate small sparkline charts directly in the browser

jQuery Sparklines This jQuery plugin makes it easy to generate a number of different types of sparklines directly in the browser, using online a line

Gareth Watts 1.2k Jan 4, 2023
📈 A small, fast chart for time series, lines, areas, ohlc & bars

?? μPlot A small (~35 KB min), fast chart for time series, lines, areas, ohlc & bars (MIT Licensed) Introduction μPlot is a fast, memory-efficient Can

Leon Sorokin 7.5k Jan 7, 2023
Simple package to facilitate and automate the use of charts in Laravel 5.x using Chartjs v2 library

laravel-chartjs - Chart.js v2 wrapper for Laravel 5.x Simple package to facilitate and automate the use of charts in Laravel 5.x using the Chart.js v2

Felix Costa 473 Dec 15, 2022
Helps to encode a string to base64 and decode a base64 string to a normal string.

@prashoonb/base64-encoder-decoder Installation npm install @prashoonb/base64-encoder-decoder API base64.encode(input) This function takes a byte strin

PrashoonB 4 Mar 29, 2022
This package generates a unique ID/String for different browsers. Like chrome, Firefox and any other browsers which supports canvas and audio Fingerprinting.

Broprint.js The world's easiest, smallest and powerful visitor identifier for browsers. This package generates a unique ID/String for different browse

Rajesh Royal 68 Dec 25, 2022
Pretty-print-json - 🦋 Pretty-print JSON data into HTML to indent and colorize (written in TypeScript)

pretty-print-json Pretty-print JSON data into HTML to indent and colorize (written in TypeScript) 1) Try It Out Interactive online tool to format JSON

Center Key 87 Dec 30, 2022
Javascript library for generating identicons. Running in the browser and on Node.js.

Jdenticon JavaScript library for generating highly recognizable identicons using HTML5 canvas or SVG. Live demo https://jdenticon.com Getting started

Daniel Mester Pirttijärvi 1.1k Jan 3, 2023
Package fetcher is a bot messenger which gather npm packages by uploading either a json file (package.json) or a picture representing package.json. To continue...

package-fetcher Ce projet contient un boilerplate pour un bot messenger et l'executable Windows ngrok qui va permettre de créer un tunnel https pour c

AILI Fida Aliotti Christino 2 Mar 29, 2022