@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
[v9.9.2] 2021-02-10 [BACKPORT]
Please note changes in 9.9.2 may not yet be released in future versions, as
this is a backport and patch release on the 9.9.x series of releases. Updates that
are included in the future will have a corresponding CHANGELOG entry in future
releases.### Added
- CUMULUS-2775
- Added a configurable parameter group for the RDS serverless database cluster deployed by
tf-modules/rds-cluster-tf
. The allowed parameters for the parameter group can be found in the AWS documentation of allowed parameters for an Aurora PostgreSQL cluster. By default, the following parameters are specified:
shared_preload_libraries
: pg_stat_statements,auto_explain
log_min_duration_statement
: 250
auto_explain.log_min_duration
: 250
- CUMULUS-2840
- Added an index on
granule_cumulus_id
to the RDS files table.
Changed
- CUMULUS-2847
- Move DyanmoDb table name into API keystore and initialize only on lambda cold start
- CUMULUS-2781
- Add api_config secret to hold API/Private API lambda configuration values
- CUMULUS-2775
- Changed the
timeout_action
to ForceApplyCapacityChange
by default for the RDS serverless database cluster tf-modules/rds-cluster-tf