Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@shardus/monitor-client

Package Overview
Dependencies
Maintainers
6
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@shardus/monitor-client - npm Package Compare versions

Comparing version 2.5.0 to 2.5.1

4

package.json
{
"name": "@shardus/monitor-client",
"version": "2.5.0",
"version": "2.5.1",
"description": "",

@@ -24,2 +24,2 @@ "main": "entry.js",

}
}
}

@@ -25,15 +25,15 @@ const INTERVAL = 10_000

// From https://stackoverflow.com/questions/3426404/create-a-hexadecimal-colour-based-on-a-string-with-javascript
const stringToColour = async (str) => {
const msgBuffer = new TextEncoder().encode(str)
// hash the message
const hashBuffer = await crypto.subtle.digest('SHA-256', msgBuffer)
// convert ArrayBuffer to Array
const hashArray = Array.from(new Uint8Array(hashBuffer))
// convert bytes to hex string
const hashHex = hashArray.map((b) => b.toString(16).padStart(2, '0')).join('')
return `#${hashHex.slice(0, 6)}`
var hash = 0
for (var i = 0; i < str.length; i++) {
hash = str.charCodeAt(i) + ((hash << 5) - hash)
}
var color = '#'
for (var i = 0; i < 3; i++) {
var value = (hash >> (i * 8)) & 0xff
color += ('00' + value.toString(16)).substr(-2)
}
console.log('colour', color)
return color
}

@@ -40,0 +40,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