Newfangled Package Modernizer
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

@sindresorhus/string-hash

1.0.0 • Public • Published

string-hash Build Status

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 a positive integer.

License

MIT © Sindre Sorhus

install

npm i @sindresorhus/string-hash

Downloadsweekly downloads

266

version

1.0.0

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability