@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
Param | Type | Description |
---|
algorithm | string | Checksum algorithm type |
stream | stream.Readable | A readable file stream |
[options] | Object | Checksum 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
Param | Type | Description |
---|
algorithm | string | Checksum algorithm |
stream | stream.Readable | A readable file stream |
expectedSum | number | string | expected checksum |
[options] | Object | Checksum 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
[v18.5.1] 2024-10-25
Please note changes in v18.5.1 may not yet be released in future versions, as this
is a backport/patch release on the v18.5.x series of releases. Updates that are
included in the future will have a corresponding CHANGELOG entry in future releases.
Added
- CUMULUS-3773
- Added sftpFastDownload configuration to SyncGranule task.
- Updated
@cumulus/sftp-client
and @cumulus/ingest/SftpProviderClient
to support both regular and fastDownload. - Added sftp support to FakeProvider
- Added sftp integration test
- CUMULUS-3756
- Added excludeFileRegex configuration to UpdateGranulesCmrMetadataFileLinks
- This is to allow files matching specified regex to be excluded when updating the Related URLs list
- Defaults to the current behavior of excluding no files.
- CUMULUS-3919
- Added terraform variables
disableSSL
and rejectUnauthorized
to tf-modules/cumulus-rds-tf
module.
Changed
- CUMULUS-3928
- updated publish scripting to use cumulus.bot@gmail.com for user email
- updated publish scripting to use esm over common import of latest-version
- updated bigint testing to remove intermitted failure source.
- updated postgres dependency version
- CUMULUS-3838
- Updated python dependencies to latest:
- cumulus-process-py 1.4.0
- cumulus-message-adapter-python 2.3.0
Fixed
- CUMULUS-3902
- Update error handling to use AWS SDK V3 error classes instead of properties
on js objects