predictable-hash

1.1.1 • Public • Published

prerender-loader

predictable-hash npm

Small lib that makes predictable hashes out of an array of words

Usage

Without options

const predictableHash = require("predictable-hash")
const hash = predictableHash(["my", "combination"])
// returns 8444-4245-5781-0635

Salting the result

const predictableHash = require("predictable-hash")
const hash = predictableHash(["my", "combination"], { salt: ["S", "A", "L", "T", "Y"] })
// returns 2847-6324-1670-5892

Options

Option Type Default Description
salt string[] [] Characters that are pseudo-randomly added between the provided word array
separator string - Separator for each group of numbers. If undefined, it will use , instead

Dependencies (0)

    Dev Dependencies (2)

    Package Sidebar

    Install

    npm i predictable-hash

    Weekly Downloads

    6

    Version

    1.1.1

    License

    MIT

    Unpacked Size

    4.2 kB

    Total Files

    4

    Last publish

    Collaborators

    • agustingonzalezmurua