Node.js file fingerprinting
Returns hash digest (fingerprint) of a given file or stream in node.js Any hash algorithm that node.js crypto supports can be given.
Install
npm i fprint -S
API
Package includes TypeScript definitions.
fprint
Returns a Promise that resolves to a string with algorithm hex hash digest for a given input.
input - either Buffer
, ReadStream
or file path. Supports both relative and absolute paths
;;;;; ; ;
digestSync
Accepts Buffer and creates it's digest
; ;;;
digestStream
Accepts stream and creates it's digest
Testing
shasum -a 256 ./test/fixtures/files/* | awk '{print $1}' > ./test/fixtures/sums/sha256
md5 -q ./test/fixtures/files/* > ./test/fixtures/sums/md5
npm test