@cjser/sindresorhus__string-hash
v2.0.0-cjser.2
Published
Get the hash of a string
Maintainers
Readme
string-hash
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-hashUsage
import stringHash from '@sindresorhus/string-hash';
stringHash('🦄🌈');
//=> 2868248295
stringHash('👌😎');
//=> 2903279002It returns the hash as a positive integer.
cjser
This package is a CommonJS-compatible build generated by cjser for projects that still need require() support. The source version matches the original npm package version, with a cjser prerelease suffix for this generated build.
Original repository: https://github.com/sindresorhus/string-hash
