Get the hash of a string
Uses the non-cryptographic hash function FNV-1a.
Similar to Java's String#hashCode()
.
Install
$ npm install @sindresorhus/string-hash
Usage
const stringHash = require('@sindresorhus/string-hash');
stringHash('🦄🌈');
//=> 582881315
stringHash('👌😎');
//=> 879086135
It returns the hash as a positive integer.
License
MIT © Sindre Sorhus