All Projects β†’ sindresorhus β†’ Fnv1a

sindresorhus / Fnv1a

Licence: mit
FNV-1a non-cryptographic hash function

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Fnv1a

ugql
πŸš€GraphQL.js over HTTP with uWebSockets.js
Stars: ✭ 27 (-73.27%)
Mutual labels:  npm-package, node-module
Figures
Unicode symbols with Windows CMD fallbacks
Stars: ✭ 438 (+333.66%)
Mutual labels:  npm-package, node-module
djb2a
DJB2a non-cryptographic hash function
Stars: ✭ 31 (-69.31%)
Mutual labels:  npm-package, node-module
Transliterate
Convert Unicode characters to Latin characters using transliteration
Stars: ✭ 152 (+50.5%)
Mutual labels:  npm-package, node-module
Is
Type check values
Stars: ✭ 1,011 (+900.99%)
Mutual labels:  npm-package, node-module
Gh Got
Convenience wrapper for Got to interact with the GitHub API
Stars: ✭ 156 (+54.46%)
Mutual labels:  npm-package, node-module
midtrans-node
Unoffficial Midtrans Payment API Client for Node JS | Alternative for Midtrans Official Module | https://midtrans.com
Stars: ✭ 15 (-85.15%)
Mutual labels:  npm-package, node-module
sdbm
SDBM non-cryptographic hash function
Stars: ✭ 43 (-57.43%)
Mutual labels:  npm-package, node-module
Conf
Simple config handling for your app or module
Stars: ✭ 707 (+600%)
Mutual labels:  npm-package, node-module
Node Module Boilerplate
Boilerplate to kickstart creating a Node.js module
Stars: ✭ 668 (+561.39%)
Mutual labels:  npm-package, node-module
Aws Lambda Libreoffice
85 MB LibreOffice to fit inside AWS Lambda compressed with Brotli
Stars: ✭ 145 (+43.56%)
Mutual labels:  npm-package, node-module
String Hash
Get the hash of a string
Stars: ✭ 56 (-44.55%)
Mutual labels:  npm-package, node-module
Update Notifier
The idea for this module came from the desire to apply the browser update strategy to CLI tools, where everyone is always on the latest version. We first tried automatic updating, which we discovered wasn't popular. This is the second iteration of that idea, but limited to just update notifications.
Stars: ✭ 1,594 (+1478.22%)
Mutual labels:  npm-package, node-module
Singlespotify
🎡 Create Spotify playlists based on one artist through the command line
Stars: ✭ 254 (+151.49%)
Mutual labels:  npm-package, node-module
P Queue
Promise queue with concurrency control
Stars: ✭ 1,863 (+1744.55%)
Mutual labels:  npm-package, node-module
Rando.js
The world's easiest, most powerful random function.
Stars: ✭ 659 (+552.48%)
Mutual labels:  npm-package, node-module
Awesome Node Utils
some useful npm packages for nodejs itself
Stars: ✭ 51 (-49.5%)
Mutual labels:  npm-package, node-module
Node Loadbalance
A collection of distilled load balancing engines
Stars: ✭ 79 (-21.78%)
Mutual labels:  npm-package, node-module
Rollup Plugin Chrome Extension
A feature-rich solution for bundled Chrome extensions! πŸ’―
Stars: ✭ 89 (-11.88%)
Mutual labels:  npm-package
Airtap
Run TAP unit tests in 1789+ browsers.
Stars: ✭ 1,364 (+1250.5%)
Mutual labels:  npm-package

fnv1a

FNV-1a non-cryptographic hash function

FNV-1a has outstanding distribution and collisions are rare.

FNV hashes are designed to be fast while maintaining a low collision rate. The FNV speed allows one to quickly hash lots of data while maintaining a reasonable collision rate. The high dispersion of the FNV hashes makes them well suited for hashing nearly identical strings such as URLs, hostnames, filenames, text, IP addresses, etc.

Install

$ npm install @sindresorhus/fnv1a

Usage

const fnv1a = require('@sindresorhus/fnv1a');

fnv1a('πŸ¦„πŸŒˆ');
//=> 2868248295

fnv1a.bigInt('πŸ¦„πŸŒˆ', {size: 128});
//=> 13487074350300261116944693128525960095n

API

fnv1a(string)

Returns the hash as a 32-bit positive integer.

fnv1a.bigInt(string, options?)

Generate a larger hash using BigInt.

Returns the hash as a positive BigInt.

options

Type: object

size

Type: number
Values: 32 | 64 | 128 | 256 | 512 | 1024

The bit size of the hash.

Related

  • djb2a - DJB2a non-cryptographic hash function
  • sdbm - SDBM non-cryptographic hash function
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].