simple-file-verification

    1.1.0 • Public • Published

    simple-file-verification

    npm npm CircleCI David

    Library to calculate SFV checksums from files and streams (see Simple File Verification for details)

    Installation

    npm install simple-file-verification -S

    Usage

    import * as SFV from 'simple-file-verification';
    import { createReadStream } from 'fs';
     
    (async() => {
      await SFV.fromFile('/path/to/file');
      await SFV.fromFile('/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

    Install

    npm i simple-file-verification

    DownloadsWeekly Downloads

    9

    Version

    1.1.0

    License

    MIT

    Unpacked Size

    20.6 kB

    Total Files

    6

    Last publish

    Collaborators

    • avatar