A fast string hashing function for Node.JS. The particular algorithm is quite
djb2, by Dan Bernstein and available
here. Differences include iterating
operator instead of the addition operator (as described at that page and
The hashing function returns a number between 0 and 4294967295 (inclusive).
npm install string-hash or
yarn add string-hash, then:
const stringHash = require("string-hash"); console.log(stringHash("foo")); // prints "193420387"
Note that the return value is always an unsigned, 32-bit integer.
To the extend possible by law, The Dark Sky Company, LLC has waived all copyright and related or neighboring rights to this library.