@pushrocks/smarthash
Advanced tools
Comparing version 2.1.6 to 2.1.9
{ | ||
"gitzone": { | ||
"projectType": "npm", | ||
"module": { | ||
@@ -4,0 +5,0 @@ "githost": "gitlab.com", |
{ | ||
"name": "@pushrocks/smarthash", | ||
"version": "2.1.6", | ||
"version": "2.1.9", | ||
"private": false, | ||
"description": "simplified access to node hash functions", | ||
"main": "dist/index.js", | ||
"typings": "dist/index.d.ts", | ||
"main": "dist_ts/index.js", | ||
"typings": "dist_ts/index.d.ts", | ||
"scripts": { | ||
"test": "(tstest test/)", | ||
"build": "(tsbuild)" | ||
"test": "(tstest test/ --web)", | ||
"build": "(tsbuild --web)" | ||
}, | ||
@@ -27,20 +27,16 @@ "repository": { | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/pushrocks/nodehash/issues" | ||
}, | ||
"homepage": "https://github.com/pushrocks/nodehash#readme", | ||
"devDependencies": { | ||
"@gitzone/tsbuild": "^2.1.17", | ||
"@gitzone/tsrun": "^1.2.8", | ||
"@gitzone/tstest": "^1.0.28", | ||
"@pushrocks/tapbundle": "^3.2.0", | ||
"@types/node": "^12.12.17", | ||
"tslint": "^5.20.1", | ||
"@gitzone/tsbuild": "^2.1.25", | ||
"@gitzone/tsrun": "^1.2.12", | ||
"@gitzone/tstest": "^1.0.52", | ||
"@pushrocks/tapbundle": "^3.2.14", | ||
"@types/node": "^14.14.31", | ||
"tslint": "^6.1.3", | ||
"tslint-config-prettier": "^1.18.0" | ||
}, | ||
"dependencies": { | ||
"@pushrocks/smartjson": "^3.0.10", | ||
"@pushrocks/smartpromise": "^3.0.6", | ||
"@types/through2": "^2.0.34", | ||
"through2": "^3.0.1" | ||
"@pushrocks/smartjson": "^4.0.6", | ||
"@pushrocks/smartpromise": "^3.1.3", | ||
"@types/through2": "^2.0.36", | ||
"through2": "^4.0.2" | ||
}, | ||
@@ -51,3 +47,4 @@ "files": [ | ||
"dist/**/*", | ||
"dist_web/**/*", | ||
"dist_*/**/*", | ||
"dist_ts/**/*", | ||
"dist_ts_web/**/*", | ||
@@ -58,3 +55,6 @@ "assets/**/*", | ||
"readme.md" | ||
], | ||
"browserslist": [ | ||
"last 1 chrome versions" | ||
] | ||
} |
@@ -11,10 +11,17 @@ # @pushrocks/smarthash | ||
## Status for master | ||
[![build status](https://gitlab.com/pushrocks/smarthash/badges/master/build.svg)](https://gitlab.com/pushrocks/smarthash/commits/master) | ||
[![coverage report](https://gitlab.com/pushrocks/smarthash/badges/master/coverage.svg)](https://gitlab.com/pushrocks/smarthash/commits/master) | ||
[![npm downloads per month](https://img.shields.io/npm/dm/@pushrocks/smarthash.svg)](https://www.npmjs.com/package/@pushrocks/smarthash) | ||
[![Known Vulnerabilities](https://snyk.io/test/npm/@pushrocks/smarthash/badge.svg)](https://snyk.io/test/npm/@pushrocks/smarthash) | ||
[![TypeScript](https://img.shields.io/badge/TypeScript->=%203.x-blue.svg)](https://nodejs.org/dist/latest-v10.x/docs/api/) | ||
[![node](https://img.shields.io/badge/node->=%2010.x.x-blue.svg)](https://nodejs.org/dist/latest-v10.x/docs/api/) | ||
[![JavaScript Style Guide](https://img.shields.io/badge/code%20style-prettier-ff69b4.svg)](https://prettier.io/) | ||
Status Category | Status Badge | ||
-- | -- | ||
GitLab Pipelines | [![pipeline status](https://gitlab.com/pushrocks/smarthash/badges/master/pipeline.svg)](https://lossless.cloud) | ||
GitLab Pipline Test Coverage | [![coverage report](https://gitlab.com/pushrocks/smarthash/badges/master/coverage.svg)](https://lossless.cloud) | ||
npm | [![npm downloads per month](https://badgen.net/npm/dy/@pushrocks/smarthash)](https://lossless.cloud) | ||
Snyk | [![Known Vulnerabilities](https://badgen.net/snyk/pushrocks/smarthash)](https://lossless.cloud) | ||
TypeScript Support | [![TypeScript](https://badgen.net/badge/TypeScript/>=%203.x/blue?icon=typescript)](https://lossless.cloud) | ||
node Support | [![node](https://img.shields.io/badge/node->=%2010.x.x-blue.svg)](https://nodejs.org/dist/latest-v10.x/docs/api/) | ||
Code Style | [![Code Style](https://badgen.net/badge/style/prettier/purple)](https://lossless.cloud) | ||
PackagePhobia (total standalone install weight) | [![PackagePhobia](https://badgen.net/packagephobia/install/@pushrocks/smarthash)](https://lossless.cloud) | ||
PackagePhobia (package size on registry) | [![PackagePhobia](https://badgen.net/packagephobia/publish/@pushrocks/smarthash)](https://lossless.cloud) | ||
BundlePhobia (total size when bundled) | [![BundlePhobia](https://badgen.net/bundlephobia/minzip/@pushrocks/smarthash)](https://lossless.cloud) | ||
Platform support | [![Supports Windows 10](https://badgen.net/badge/supports%20Windows%2010/yes/green?icon=windows)](https://lossless.cloud) [![Supports Mac OS X](https://badgen.net/badge/supports%20Mac%20OS%20X/yes/green?icon=apple)](https://lossless.cloud) | ||
## Usage | ||
@@ -21,0 +28,0 @@ |
import * as plugins from './nodehash.plugins'; | ||
export const hashStreamPipeStop = resolveFuntion => { | ||
export const hashStreamPipeStop = (resolveFuntion) => { | ||
const forEach = (chunk: Buffer, enc, cb) => { | ||
@@ -9,3 +9,3 @@ resolveFuntion(chunk.toString('utf8')); | ||
const atEnd = cb => { | ||
const atEnd = (cb) => { | ||
cb(); | ||
@@ -12,0 +12,0 @@ }; |
import * as plugins from './nodehash.plugins'; | ||
export const md5FromString = async (stringToHash: string) => { | ||
return plugins.crypto | ||
.createHash('md5') | ||
.update(stringToHash) | ||
.digest('hex'); | ||
return plugins.crypto.createHash('md5').update(stringToHash).digest('hex'); | ||
}; |
@@ -29,3 +29,3 @@ import * as plugins from './nodehash.plugins'; | ||
*/ | ||
export let sha256FromStringSync = (stringArg): string => { | ||
export const sha256FromStringSync = (stringArg: string): string => { | ||
const hash = plugins.crypto.createHash('sha256'); | ||
@@ -47,8 +47,18 @@ hash.update(stringArg); | ||
/** | ||
* Computes sha256 Hash from String | ||
*/ | ||
export const sha256FromBuffer = async (bufferArg: Buffer): Promise<string> => { | ||
const hash = plugins.crypto.createHash('sha256'); | ||
hash.update(bufferArg); | ||
const hashResult = hash.digest('hex'); | ||
return hashResult; | ||
}; | ||
/** | ||
* computes sha265 Hash from Object | ||
*/ | ||
export const sha265FromObject = async (objectArg: any): Promise<string> => { | ||
const stringifiedObject = plugins.smartjson.Smartjson.stringify(objectArg, {}); | ||
const stringifiedObject = plugins.smartjson.stringify(objectArg, {}); | ||
const hashResult = await sha256FromString(stringifiedObject); | ||
return hashResult; | ||
}; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
22937
335
76
1
+ Added@pushrocks/smartjson@4.0.6(transitive)
+ Added@types/buffer-json@2.0.3(transitive)
+ Added@types/node@22.5.5(transitive)
+ Addedbuffer-json@2.0.0(transitive)
+ Addedthrough2@4.0.2(transitive)
- Removed@pushrocks/smartjson@3.0.10(transitive)
- Removed@types/node@22.6.1(transitive)
- Removedthrough2@3.0.2(transitive)
Updated@pushrocks/smartjson@^4.0.6
Updated@types/through2@^2.0.36
Updatedthrough2@^4.0.2