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

@cumulus/checksum

Package Overview
Dependencies
Maintainers
8
Versions
148
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cumulus/checksum - npm Package Compare versions

Comparing version 1.22.1 to 1.23.0

27

package.json
{
"name": "@cumulus/checksum",
"version": "1.22.1",
"version": "1.23.0",
"description": "Cumulus checksum utilities",

@@ -8,7 +8,19 @@ "engines": {

},
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"files": [
"./dist/**/*.js",
"./dist/**/*.d.ts"
],
"scripts": {
"test": "ava",
"test-coverage": "nyc ava",
"debug": "NODE_ENV=test node --inspect-brk node_modules/ava/profile.js --serial tests/*.js"
"build-docs": "npm run tsc && ../../node_modules/.bin/jsdoc2md -t templates/README.md.hbs ./dist/*.js > README.md",
"test": "../../node_modules/.bin/ava",
"test-coverage": "../../node_modules/.bin/nyc npm test",
"debug": "NODE_ENV=test node --inspect-brk node_modules/ava/profile.js --serial tests/*.js",
"tsc": "../../node_modules/.bin/tsc",
"prepare": "npm run tsc"
},
"ava": {
"timeout": "15m"
},
"nyc": {

@@ -25,2 +37,3 @@ "exclude": [

},
"homepage": "https://github.com/nasa/cumulus/tree/master/packages/checksum/README.md",
"repository": {

@@ -35,7 +48,3 @@ "type": "git",

},
"devDependencies": {
"ava": "^2.1.0",
"nyc": "^14.0.0"
},
"gitHead": "3afec6cb6b37c3695fe9c78b4c3136f02337563f"
"gitHead": "68df6858844a6cd826d62801c34ae549871ce774"
}
# @cumulus/checksum
## About Cumulus
Cumulus is a cloud-based data ingest, archive, distribution and management prototype for NASA's
future Earth science data streams.
[Cumulus Documentation](https://nasa.github.io/cumulus)
## 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](https://nodejs.org/api/crypto.html#crypto_crypto_createhash_algorithm_options).
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](https://nodejs.org/api/crypto.html#crypto_crypto_createhash_algorithm_options).

@@ -25,1 +20,51 @@ ## Usage

```
## API
<a name="module_checksum"></a>
## checksum
* [checksum](#module_checksum)
* [.generateChecksumFromStream(algorithm, stream, [options])](#module_checksum.generateChecksumFromStream) ⇒ <code>Promise.&lt;(number\|string)&gt;</code>
* [.validateChecksumFromStream(algorithm, stream, expectedSum, [options])](#module_checksum.validateChecksumFromStream) ⇒ <code>Promise.&lt;boolean&gt;</code>
<a name="module_checksum.generateChecksumFromStream"></a>
### checksum.generateChecksumFromStream(algorithm, stream, [options]) ⇒ <code>Promise.&lt;(number\|string)&gt;</code>
Create <algorithm> file checksum from readable stream
**Kind**: static method of [<code>checksum</code>](#module_checksum)
**Returns**: <code>Promise.&lt;(number\|string)&gt;</code> - the file checksum
| Param | Type | Description |
| --- | --- | --- |
| algorithm | <code>string</code> | Checksum algorithm type |
| stream | <code>stream.Readable</code> | A readable file stream |
| [options] | <code>Object</code> | Checksum options, see `crypto.createHash()` |
<a name="module_checksum.validateChecksumFromStream"></a>
### checksum.validateChecksumFromStream(algorithm, stream, expectedSum, [options]) ⇒ <code>Promise.&lt;boolean&gt;</code>
Validate expected checksum against calculated checksum
**Kind**: static method of [<code>checksum</code>](#module_checksum)
**Returns**: <code>Promise.&lt;boolean&gt;</code> - whether expectedSum === calculatedSum
| Param | Type | Description |
| --- | --- | --- |
| algorithm | <code>string</code> | Checksum algorithm |
| stream | <code>stream.Readable</code> | A readable file stream |
| expectedSum | <code>number</code> \| <code>string</code> | expected checksum |
| [options] | <code>Object</code> | 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](https://nasa.github.io/cumulus)
---
Generated automatically using `npm run build-docs`
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