🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

@cumulus/checksum

Package Overview
Dependencies
Maintainers
6
Versions
171
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cumulus/checksum

Cumulus checksum utilities

release-v20.3.1
Source
npmnpm
Version
20.3.1
Version published
Maintainers
6
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

CUMULUS

FAQs

Package last updated on 14 Oct 2025

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