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

cyclical-object-hash

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cyclical-object-hash - npm Package Compare versions

Comparing version 0.0.5 to 0.1.0

14

index.js

@@ -1,2 +0,2 @@

const stringify = require('fast-json-stable-stringify')
const stringify = require('safe-stable-stringify')
const blake2b = require('blake2b')

@@ -10,14 +10,4 @@

var output = new Uint8Array(64)
var string
var string = stringify(object)
try {
string = stringify(object)
} catch (error) {
if (error.message.indexOf('circular') >= 0) {
string = stringify(object, {cycles: true})
} else {
throw error
}
}
return blake2b(output.length).update(Buffer.from(string))

@@ -24,0 +14,0 @@ }

4

package.json
{
"name": "cyclical-object-hash",
"version": "0.0.5",
"version": "0.1.0",
"description": "Deterministically hash a cyclical object with blake2b",

@@ -23,3 +23,3 @@ "main": "index.js",

"blake2b": "2.1.3",
"fast-json-stable-stringify": "2.0.0"
"safe-stable-stringify": "^1.1.0"
},

@@ -26,0 +26,0 @@ "devDependencies": {

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