Socket
Socket
Sign inDemoInstall

browserify-sha3

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

browserify-sha3 - npm Package Compare versions

Comparing version 0.0.4 to 0.0.5

benchmark/node_modules/benchmark/benchmark.js

10

index.js
const Sha3 = require('js-sha3')
const Buffer = require('safe-buffer').Buffer
const hashLengths = [ 224, 256, 384, 512 ]
const hashLengths = [224, 256, 384, 512]

@@ -18,3 +18,3 @@ const hash = function (bitcount) {

} else if (typeof i === 'string') {
this.content.push(new Buffer(i))
this.content.push(Buffer.from(i))
} else {

@@ -26,8 +26,8 @@ throw new Error('Unsupported argument to update')

hash.prototype.digest = function (encoding) {
hash.prototype.digest = function (encoding = 'binary') {
const result = Sha3[this.bitcount](Buffer.concat(this.content))
if (encoding === 'hex') {
return result
} else if (encoding === 'binary' || encoding === undefined) {
return new Buffer(result, 'hex').toString('binary')
} else if (encoding === 'binary') {
return Buffer.from(result, 'hex')
} else {

@@ -34,0 +34,0 @@ throw new Error('Unsupported encoding for digest: ' + encoding)

{
"name": "browserify-sha3",
"version": "0.0.4",
"version": "0.0.5",
"description": "node-sha3 compatability for browserify",
"main": "index.js",
"scripts": {
"lint": "standard",
"test": "node ./tests"

@@ -11,3 +12,3 @@ },

"type": "git",
"url": "git+https://github.com/wanderer/browserify-sha3.git"
"url": "git+https://gitlab.com/mjbecze/browserify-sha3.git"
},

@@ -21,13 +22,19 @@ "keywords": [

"bugs": {
"url": "https://github.com/wanderer/browserify-sha3/issues"
"url": "https://gitlab.com/mjbecze/browserify-sha3/issues"
},
"homepage": "https://github.com/wanderer/browserify-sha3#readme",
"homepage": "https://gitlab.com/mjbecze/browserify-sha3#readme",
"devDependencies": {
"sha3": "^1.1.0",
"tape": "^4.0.1"
"sha3": "^2.0.6",
"tape": "^4.11.0",
"standard": "^13.1.0"
},
"dependencies": {
"js-sha3": "^0.6.1",
"safe-buffer": "^5.1.1"
"js-sha3": "^0.8.0",
"safe-buffer": "^5.2.0"
},
"standard": {
"ignore": [
"/benchmark/"
]
}
}

@@ -8,3 +8,3 @@ var SHA3 = require('sha3')

t.plan(2)
// Generate 512-bit digest.
// Generate 512-bit digest.
var d = new SHA3.SHA3Hash()

@@ -19,7 +19,7 @@ d.update('foo')

// Generate 224-bit digest.
var d = new SHA3.SHA3Hash(224)
d = new SHA3.SHA3Hash(224)
d.update('foo')
// Generate 224-bit digest.
var bd = new BSHA3.SHA3Hash(224)
bd = new BSHA3.SHA3Hash(224)
bd.update('foo')

@@ -47,3 +47,3 @@ t.equal(d.digest('hex'), bd.digest('hex'))

var data = crypto.randomBytes(32)
// Generate 512-bit digest.
// Generate 512-bit digest.
var d = new SHA3.SHA3Hash()

@@ -50,0 +50,0 @@ d.update(data)

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