
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
ac-filehash
Advanced tools
Create a hash for local files or from URL without loading the complete file
Create a hash from a file. The source can be a local file, ArrayBuffer, URL or an AWS s3 bucket/key.
This hash is created using 3 sections of the file - one at the beginning, one in the middle and one at the end. This way, a hash can be easily and fast created even for large files.
const acfh = require('ac-filehash')
let test = async () => {
let result = await acfh.getHash({
filePath: './test/BigBuckBunny.mp4'
})
// RESPONSE
{
error: undefined,
type: 'file',
hash: 'f9ccc07b4959f5698fd30913743aacd5',
fileSize: 158008374
}
}
test()
const acfh = require('ac-filehash')
let test = async () => {
let result = await acfh.getHash({
url: 'https://www.w3schools.com/html/mov_bbb.mp4'
})
// RESPONSE
{
error: undefined,
type: 'url',
hash: '36b8a0600d15fda64892726b94cc43fd',
fileSize: 788493
}
}
test()
If no credentials are sent, the one's from your local AWS configuration are used.
const acfh = require('ac-filehash')
let test = async () => {
let result = await acfh.getHash({
bucket: 'mybucket',
key: 'mykey',
// optional credentials
credentials: {
accessKeyId: 'ABC',
secretAccessKey: 'SECRET',
// optional session token if you are using temporary credentials
sessionToken: 'token'
}
})
// RESPONSE
{
error: undefined,
type: 's3',
hash: 'f9ccc07b4959f5698fd30913743aacd5',
fileSize: 158008374
}
}
test()
const acfh = require('ac-filehash/browser')
let test = async () => {
let result = await acfh.getHash({
url: 'https://www.w3schools.com/html/mov_bbb.mp4'
})
// RESPONSE
{
error: undefined,
type: 'url',
hash: '36b8a0600d15fda64892726b94cc43fd',
fileSize: 788493
}
let result = await acfh.getHash({
buffer: some_ArrayBuffer //<- e.g. ArrayBuffer generated from file through input field
})
// RESPONSE
{
error: undefined,
type: 'buffer',
hash: 'f9ccc07b4959f5698fd30913743aacd5',
fileSize: 158008374
}
}
test()
MIT License Copyright © 2009-present, AdmiralCloud AG
FAQs
Create a hash for local files or from URL without loading the complete file
We found that ac-filehash 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.