predictable-hash
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 |