Security News
Input Validation Vulnerabilities Dominate MITRE's 2024 CWE Top 25 List
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Convenience ES6 hashing library. Supports object, array and string hashing for md5 and sha256
$ npm install arc-hash --save
const ArcHash = require('arc-hash');
// This is an example complex object that reduces to scalar value
const exampleObject = {
'B': 5,
'D': {
'Zebra': 'Camel',
'Antelope': [0,2,
{
'Deep':'Mind'
},
['omega','alpha']
]
},
'A': 'Is a String',
};
console.log(ArcHash.md5(exampleObject));
/*
Output: 7d388f6ec86c79805a534c910471c7c7
Any change to the object including changing the order of an array, or changing the case in a key or a value will result in a new hash
*/
Take an unknown value and return an md5 hash representing it
Take an unknown value and return a sha256 hash representing it
Array order matters for a hash, object order assignment does not.
Keys and values are case sensitive
Circular object references are not handled
String() is eventually applied to all values, so 5 and '5' will not be seen as different values
This is not incredibly performant, and should not be used for dynamic comparison over potentially large data sets
npm test
FAQs
ES6 convenience library for hashing arrays, objects, strings as md5 or sha256
The npm package arc-hash receives a total of 1,197 weekly downloads. As such, arc-hash popularity was classified as popular.
We found that arc-hash demonstrated a healthy version release cadence and project activity because the last version was released less than 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
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.