New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
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 1.1.0 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/
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc