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

@nlv8/signun

Package Overview
Dependencies
Maintainers
5
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nlv8/signun - npm Package Compare versions

Comparing version 1.2.1 to 1.3.0

dependencies/BLAKE2/.git

7

package.json
{
"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

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