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

deterministic-json

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

deterministic-json - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3

README.md

8

index.js

@@ -27,2 +27,8 @@ let stableStringify = require('json-stable-stringify')

// converts buffer to base64 and strips trailing equals chars
function bufferToBase64 (buffer) {
let actualLength = Math.floor(buffer.length / 3) * 4 + 2
return buffer.toString('base64').slice(0, actualLength)
}
function bufferToBase64Replacer (key, value) {

@@ -40,3 +46,3 @@ // convert JSON.stringified Buffer objects to Buffer,

if (!Buffer.isBuffer(value)) return value
return `${base64Prefix}${value.toString('base64')}`
return `${base64Prefix}${bufferToBase64(value)}`
}

@@ -43,0 +49,0 @@

2

package.json
{
"name": "deterministic-json",
"version": "1.0.2",
"version": "1.0.3",
"description": "Deterministic JSON parse/stringify that supports Buffers",

@@ -5,0 +5,0 @@ "main": "index.js",

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