![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
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 (e.g. 83c3d381c38985a5
)
Parameters:
filepath
- path to the image, or Buffer
bits
(optional) - hash length [default: 64
]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, depending on your CPU)
.close()
Close all underlying workers. If you use the asynchronous hashing algorithm, you need to call this at the end of your program to close all currently open workers. Otherwise, your program may keep running until manually interrupted.
FAQs
Perceptual image hash for node.js
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.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.