Get the hash of a string
Uses the non-cryptographic hash function FNV-1a.
Similar to Java's String#hashCode()
.
npm install @sindresorhus/string-hash
import stringHash from '@sindresorhus/string-hash';
stringHash('๐ฆ๐');
//=> 2868248295
stringHash('๐๐');
//=> 2903279002
It returns the hash as a positive integer.