New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

sb-js-data-structures

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sb-js-data-structures - npm Package Compare versions

Comparing version 1.0.7 to 1.0.8

3

package.json
{
"name": "sb-js-data-structures",
"version": "1.0.7",
"version": "1.0.8",
"repository": {

@@ -19,2 +19,3 @@ "type": "git",

"linked list",
"doubly linked list",
"bst",

@@ -21,0 +22,0 @@ "binary search tree",

@@ -13,4 +13,17 @@ const KEY = 0

public hash = (key: string) => key.toString().length % this.size
public hash = (key: string) => {
let hash = 0
if (key.length == 0) {
return hash
}
for (var i = 0; i < key.length; i++) {
var char = key.charCodeAt(i)
hash = (hash << 5) - hash + char
hash = hash & hash // Convert to 32bit integer
}
return hash % this.size
}
public insert = (key: string, value: T) => {

@@ -17,0 +30,0 @@ const index = this.hash(key)

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