simple-file-verification
TypeScript icon, indicating that this package has built-in type declarations

3.0.4 • Public • Published

simple-file-verification

Library to calculate SFV checksums from files and streams.

License Version: npm Version: jsr Build: NodeJS Build: Deno

Installation

npm install simple-file-verification -S

Usage

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"));
})();

API

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.

fromFile

Usage: fromFile(filePath, algorithm?)

Returns checksum for specified file

fromFiles

Usage: fromFiles(filePath, algorithm?)

Returns array of files/checksums objects for specified glob

fromStream

Usage: fromStream(readableStream, algorithm?)

Returns checksum Node.js readable stream

Related

License

This work is licensed under The MIT License.

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
3.0.45latest

Version History

VersionDownloads (Last 7 Days)Published
3.0.45
3.0.31
3.0.21
3.0.11
3.0.02
2.0.30
2.0.20
2.0.10
2.0.00
1.1.00
1.0.11
1.0.00

Package Sidebar

Install

npm i simple-file-verification

Weekly Downloads

11

Version

3.0.4

License

MIT

Unpacked Size

87.8 kB

Total Files

6

Last publish

Collaborators

  • idleberg