Library to calculate SFV checksums from files and streams.
npm install simple-file-verification -S
import * as SFV from "simple-file-verification";
import { createReadStream } from "node:fs";
(async () => {
await SFV.fromFile("path/to/file");
await SFV.fromFiles("path/to/*.pdf");
await SFV.fromStream(createReadStream("path/to/file"));
})();
All API methods default to SFV's standard CRC32 algorithm. You can also specify the extended SFV (.sfvx
) algorithms MD5, SHA-1, SHA-256, or SHA-512.
Usage: fromFile(filePath, algorithm?)
Returns checksum for specified file
Usage: fromFiles(filePath, algorithm?)
Returns array of files/checksums objects for specified glob
Usage: fromStream(readableStream, algorithm?)
Returns checksum Node.js readable stream
This work is licensed under The MIT License.