Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
node-image-hash
Advanced tools
Perceptual image hash for node.js
npm install node-image-hash
const imageHash = require('node-image-hash');
imageHash
.hash('buffer/or/path/to/file/', 8, 'hex')
.then((hash) => {
console.log(hash.hash); // '83c3d381c38985a5'
console.log(hash.type); // 'blockhash8'
});
.hash(filepath[, bits][, format])
Returns: ES6 Promise
, resolved returns hash string in specified format and length (eg. 83c3d381c38985a5
)
Parameters:
filepath
- path to the image, or Buffer
bits
(optional) - hash length [default: 256
]format
(optional) - output format [default: hex
] (Available: hex
, latin1
, base64
, binary
).syncHash(filepath[, bits][, format])
By default .hash generates new node.js processes to calculate the hash. .syncHash will calculate the hash in the same node.js process (About 2.3x times slower)
FAQs
Perceptual image hash for node.js
The npm package node-image-hash receives a total of 128 weekly downloads. As such, node-image-hash popularity was classified as not popular.
We found that node-image-hash 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
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.