1. string-hash
fast string hashing function
string-hash
Package: string-hash
Created by: darkskyapp
Last modified: Mon, 27 Jun 2022 01:01:18 GMT
Version: 1.1.3
License: CC0-1.0
Downloads: 8,967,902
Repository: https://github.com/darkskyapp/string-hash

Install

npm install string-hash
yarn add string-hash

string-hash

A fast string hashing function for Node.JS. The particular algorithm is quite
similar to djb2, by Dan Bernstein and available
here. Differences include iterating
over the string backwards (as that is faster in JavaScript) and using the XOR
operator instead of the addition operator (as described at that page and
because it obviates the need for modular arithmetic in JavaScript).

The hashing function returns a number between 0 and 4294967295 (inclusive).

Thanks to cscott for reminding us how integers
work in JavaScript.

License

To the extend possible by law, The Dark Sky Company, LLC has waived all
copyright and related or neighboring rights
to this library.

Dependencies

RELATED POST

10 Must-Know Windows Shortcuts That Will Save You Time

10 Must-Know Windows Shortcuts That Will Save You Time

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Navigating AWS Networking: Essential Hacks for Smooth Operation

Navigating AWS Networking: Essential Hacks for Smooth Operation

Achieving Stunning Visuals with Unity's Global Illumination

Achieving Stunning Visuals with Unity's Global Illumination

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code