@nlv8/signun
Advanced tools
Comparing version 1.2.1 to 1.3.0
{ | ||
"name": "@nlv8/signun", | ||
"version": "1.2.1", | ||
"version": "1.3.0", | ||
"description": "N-API Crypto bindings.", | ||
@@ -9,3 +9,3 @@ "main": "src/js/index.js", | ||
"build": "node-gyp rebuild", | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
"test": "mocha test/**/*.mocha.js" | ||
}, | ||
@@ -28,2 +28,5 @@ "repository": { | ||
"devDependencies": { | ||
"chai": "^4.2.0", | ||
"chai-as-promised": "^7.1.1", | ||
"mocha": "^6.1.4", | ||
"node-gyp": "^4.0.0" | ||
@@ -30,0 +33,0 @@ }, |
@@ -15,2 +15,5 @@ # signun | ||
* `verify`. | ||
* [BLAKE2](https://github.com/BLAKE2/BLAKE2) | ||
* `hash` | ||
* `keyedHash` | ||
@@ -29,3 +32,3 @@ ## Install | ||
Please keep in mind, that you must have [GMP](https://gmplib.org/) installed (signun will not fallback to JS-only implementations). | ||
Please keep in mind, that for the best secp256k1 performance, you should have [GMP](https://gmplib.org/) installed. | ||
@@ -99,2 +102,20 @@ ## Examples | ||
### BLAKE2 hash | ||
#### Async | ||
~~~~JavaScript | ||
const { randomBytes } = require('crypto'); | ||
const { blake2b } = require('@nlv8/signun'); | ||
(async function main() { | ||
const data = randomBytes(64); | ||
const key = randomBytes(64); | ||
const hashLength = 64; | ||
const result = await blake2b.hash(data, hashLength); | ||
const keyedResult = await blake2b.hash(data, key, hashLength); | ||
})(); | ||
~~~~ | ||
## Acknowledgements | ||
@@ -115,1 +136,2 @@ | ||
* [secp256k1](https://github.com/bitcoin-core/secp256k1): [MIT](https://github.com/bitcoin-core/secp256k1/blob/master/COPYING) | ||
* [BLAKE2](https://github.com/BLAKE2/BLAKE2/blob/master/COPYING) |
@@ -0,1 +1,2 @@ | ||
const blake2 = require('./blake2'); | ||
const secp256k1 = require('./secp256k1'); | ||
@@ -5,3 +6,4 @@ | ||
module.exports = Object.freeze({ | ||
...blake2, | ||
secp256k1 | ||
}); |
const guard = { | ||
isIntegerBetweenInclusive(obj, min, max, errorMessage) { | ||
return Number.isInteger(obj) | ||
&& (min <= obj) | ||
&& (obj <= max); | ||
}, | ||
isBuffer(obj, errorMessage) { | ||
@@ -3,0 +8,0 @@ if (!Buffer.isBuffer(obj)) { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
Mixed license
License(Experimental) Package contains multiple licenses.
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
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
6219372
211
22243
1
134
4
2