Socket
Socket
Sign inDemoInstall

sha3

Package Overview
Dependencies
13
Maintainers
3
Versions
22
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.2.0 to 1.2.1

package-lock.json

9

package.json
{
"name": "sha3",
"version": "1.2.0",
"version": "1.2.1",
"description": "A Node.js C++ extension for SHA-3 (Keccak)",

@@ -31,11 +31,10 @@ "keywords": [

"engines": {
"node": ">= 0.10",
"iojs": ">= 1.0"
"node": ">= 8.11.1"
},
"dependencies": {
"nan": "^2.0.5"
"nan": "2.10.0"
},
"devDependencies": {
"mocha": "^2.1.0"
"mocha": "5.1.1"
}
}

@@ -5,2 +5,10 @@ var assert = require('assert');

function newBuffer(data, encoding) {
try {
return Buffer.from(data, encoding);
} catch(e) {
return new Buffer(data, encoding)
}
}
describe('SHA3', function(){

@@ -33,3 +41,3 @@

new SHA3(0);
}, "Unsupported hash length");
}, "TypeError: Unsupported hash length");
});

@@ -40,3 +48,3 @@

new SHA3(225);
}, "Unsupported hash length");
}, "TypeError: Unsupported hash length");
});

@@ -47,9 +55,9 @@

new SHA3('hi');
}, "Unsupported hash length");
}, "TypeError: Unsupported hash length");
assert.throws(function(){
new SHA3(null);
}, "Unsupported hash length");
}, "TypeError: Unsupported hash length");
assert.throws(function(){
new SHA3(-1);
}, "Unsupported hash length");
}, "TypeError: Unsupported hash length");
});

@@ -68,3 +76,4 @@ });

var sha = new SHA3(224);
var buffer = new Buffer('aloha');
var buffer = newBuffer('aloha', 'utf8');
assert.doesNotThrow(function(){

@@ -80,3 +89,3 @@ sha.update(buffer);

sha.update(arg);
}, "Not a string or buffer");
}, "TypeError: Not a string or buffer");
});

@@ -108,3 +117,3 @@ });

new SHA3().digest('buffer');
}, "Unsupported output encoding");
}, "TypeError: Unsupported output encoding");
});

@@ -111,0 +120,0 @@

Sorry, the diff of this file is not supported yet

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc