Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@cumulus/checksum

Package Overview
Dependencies
Maintainers
12
Versions
148
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cumulus/checksum

Cumulus checksum utilities

  • 10.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
174
increased by35.94%
Maintainers
12
Weekly downloads
 
Created
Source

@cumulus/checksum

Checksum

The @cumulus/checksum library provides checksum functionality used by Cumulus packages and tasks. Currently the supported input includes file streams, and supported checksum algorithms include cksum and the algorithms available to the crypto package, as documented here.

Usage

const fs = require('fs');
const { generateChecksumFromStream } = require('@cumulus/checksum');

const stream = fs.createReadStream('myDataFile.hdf');
const myCksum = generateChecksumFromStream('cksum', stream);

API

checksum

checksum.generateChecksumFromStream(algorithm, stream, [options]) ⇒ Promise.<(number|string)>

Create file checksum from readable stream

Kind: static method of checksum
Returns: Promise.<(number|string)> - the file checksum

ParamTypeDescription
algorithmstringChecksum algorithm type
streamstream.ReadableA readable file stream
[options]ObjectChecksum options, see crypto.createHash()

checksum.validateChecksumFromStream(algorithm, stream, expectedSum, [options]) ⇒ Promise.<boolean>

Validate expected checksum against calculated checksum

Kind: static method of checksum
Returns: Promise.<boolean> - whether expectedSum === calculatedSum

ParamTypeDescription
algorithmstringChecksum algorithm
streamstream.ReadableA readable file stream
expectedSumnumber | stringexpected checksum
[options]ObjectChecksum options

About Cumulus

Cumulus is a cloud-based data ingest, archive, distribution and management prototype for NASA's future Earth science data streams.

Cumulus Documentation


Generated automatically using npm run build-docs

Keywords

FAQs

Package last updated on 03 Feb 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc