hfnv
v1.0.3
Published
FNV-1a 128 hashing
Downloads
395
Maintainers
Readme
Hfnv
FNV-1a 128bit hashing utility with no external dependencies
Hfnv is a functional FNV-1a 128bit hashing utility written in TypeScript. It runs in the browser, or on the server using node.js.
Setup
yarn add hfnv
or
npm install --save hfnv
Usage
Before you start import the functions from the library
import { digest, hex, base64, base64Url, base36 } from 'hfnv'
Basic usage
// Create random UUIDs
const hash = digest('qwerty')
// Create the output
hex(hash) // 24ac7f403a3c64bf6f48c2b048d6ae31
base64(hash) // JKx/QDo8ZL9vSMKwSNauMQ==
base64Url(hash) // JKx_QDo8ZL9vSMKwSNauMQ
base36(hash) // 265uihu41nkeln5blxxfzjb5d