🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

string-hash

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

string-hash - npm Package Compare versions

Comparing version

to
1.1.1

component.json

6

index.js

@@ -9,5 +9,5 @@ module.exports = function(str) {

/* JavaScript does bitwise operations (like XOR, above) on 32-bit signed
* integers. Since we want the results to be always positive, if the high bit
* is set, unset it and add it back in through (64-bit IEEE) addition. */
return hash >= 0 ? hash : (hash & 0x7FFFFFFF) + 0x80000000
* integers. Since we want the results to be always positive, convert the
* signed int to an unsigned by doing an unsigned bitshift. */
return hash >>> 0;
}
{
"name": "string-hash",
"version": "1.1.0",
"version": "1.1.1",
"description": "fast string hashing function",

@@ -5,0 +5,0 @@ "keywords": [

@@ -12,1 +12,12 @@ string-hash

The hashing function returns a number between 0 and 4294967295 (inclusive).
Thanks to [cscott](https://github.com/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][cc0] to this library.
[cc0]: http://creativecommons.org/publicdomain/zero/1.0/