
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
hash-o-matic
Advanced tools
Pass objects or variables and the generated hash will be the same regardless of the order the parameters were passed.
Hash up an unlimited number of values, but the problem is that the final hashed value is dependent on the order in which these values are added. What hash-o-matic does is it will order the object's properties by the property name before hashing. This is useful if you frequently hash the same variables through-out your app(s) but can't recall the order in which the values were added. The only real catch is the variables must have the same naming throughout your code.
npm install hash-o-matic
/* look at the unit tests for more examples */
var hashomatic = require('hash-o-matic');
var caseinsensitive = true;
var normalizestrings = true;
var hash, hash2;
// Simple string hashing
hash = hashomatic.hash('the quick brown fox jumps over the lazy dog');
console.log(hash);
// 'case insensitive(by lower casing all)' string hashing
hash = hashomatic.hash('ThE Quick Brown fOx jUmps oveR the laZy dog', caseinsensitive, normalizestrings);
hash2 = hashomatic.hash('tHe qUICK bROWN FoX JuMPS OVEr THE LAzY DOG', caseinsensitive, normalizestrings);
console.log(hash === hash2); // true
// Object hashing; ordering, case, and normalized strings
var object = {'a': "", "b": "not empty", 'c': "", d: null},
object2 = {"a": '', 'b': 'not empty', "c": '', d: ""};
hash = hashomatic.hash(object, caseinsensitive, normalizestrings);
hash2 = hashomatic.hash(object2, caseinsensitive, normalizestrings);
console.log(hash === hash2); // true
mocha test/*.js
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code.
FAQs
Pass objects or variables and the generated hash will be the same regardless of the order the parameters were passed.
The npm package hash-o-matic receives a total of 0 weekly downloads. As such, hash-o-matic popularity was classified as not popular.
We found that hash-o-matic 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
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.