Awesome Open Source
Awesome Open Source
Sponsorship

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

License

MIT © Sindre Sorhus


Get A Weekly Email With Trending Projects For These Topics
No Spam. Unsubscribe easily at any time.
javascript (66,460
npm-package (246
node-module (65
hashing (51

Find Open Source By Browsing 7,000 Topics Across 59 Categories