Security News
UK Officials Consider Banning Ransomware Payments from Public Entities
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.
canonical-json
Advanced tools
#Canonical JSON
The goal of this module is to implement a version of JSON.stringify that returns a canonical JSON format.
Canonical JSON means that the same object should always be stringified to the exact same string.
JavaScripts native JSON.stringify does not guarantee any order for object keys when serializing:
Properties of non-array objects are not guaranteed to be stringified in any particular order. Do not rely on ordering of properties within the same object within the stringification.
Source: https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/JSON/stringify
This module implements two alternative solutions to this problem:
It currently exports the index.js version.
##Performance comparison I compared the performance of native JSON.stringify and the two alternative implementations that output keys sorted:
75 ms
308 ms
291 ms
The tests were run in Node.js on a 2011 MacBook Pro.
Performance test source: test/performance.js
FAQs
a canonical json implementation
We found that canonical-json demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.
Security News
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.