sumchecker
Checksum validator
Last updated 5 years ago by malept .
Apache-2.0 · Repository · Bugs · Original npm · Tarball · package.json
$ gnpm install sumchecker 
SYNC missed versions from official npm registry.

Sumchecker

Travis CI AppVeyor CI Code Coverage Dependency Status

Sumchecker is a pure Node.js solution to validating files specified in a checksum file, which are usually generated by programs such as sha256sum.

Usage

const sumchecker = require('sumchecker');

try {
  await sumchecker(algorithm, checksumFilename, baseDir, filesToCheck);
  console.log('All files validate!');
} catch (error) {
  console.error('An error occurred', error);
}

Returns a Promise. The promise is resolved when all files specified in filesToCheck are validated. The promise is rejected otherwise.

Parameters

algorithm

String - The hash algorithm used in checksumFilename. Corresponds to the algorithms allowed by crypto.createHash().

checksumFilename

String - The path to the checksum file.

baseDir

String - The base directory for the files specified in filesToCheck.

filesToCheck

Array or String - one or more paths of the files that will be validated, relative to baseDir.

Errors

These are sumchecker-specific error classes that are passed to the promise's reject callback.

sumchecker.ChecksumMismatchError

When at least one of the files does not match its expected checksum.

Properties:

  • filename (String) - a path to a file that did not match

sumchecker.ChecksumParseError

When the checksum file cannot be parsed (as in, it does not match the checksum file format).

Properties:

  • lineNumber (Number) - the line number that could not be parsed
  • line (String) - the raw line data that could not be parsed, sans newline

sumchecker.NoChecksumFoundError

When at least one of the files specified to check is not listed in the checksum file.

Properties:

Support

Get supported sumchecker with the Tidelift Subscription.

Security contact information

To report a security vulnerability, please use the Tidelift security contact. Tidelift will coordinate the fix and disclosure.

Legal

This library is copyrighted under the terms of the Apache 2.0 License.

Current Tags

  • 3.0.1                                ...           latest (5 years ago)

10 Versions

  • 3.0.1                                ...           5 years ago
  • 3.0.0                                ...           5 years ago
  • 2.0.2                                ...           8 years ago
  • 1.3.1                                ...           8 years ago
  • 2.0.1                                ...           8 years ago
  • 2.0.0                                ...           8 years ago
  • 1.3.0                                ...           8 years ago
  • 1.2.0                                ...           8 years ago
  • 1.1.0                                ...           8 years ago
  • 1.0.0                                ...           8 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (1)
Dev Dependencies (11)

Copyright 2013 - present © cnpmjs.org | Home |