Skip to content
This repository has been archived by the owner on Jun 17, 2021. It is now read-only.

Commit

Permalink
Merge pull request #64 from ethereumjs/feature/keccak
Browse files Browse the repository at this point in the history
Use keccak instead keccakjs
  • Loading branch information
wanderer committed Jan 6, 2017
2 parents f0f2aae + 75f5294 commit 0e246cd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
8 changes: 2 additions & 6 deletions index.js
@@ -1,4 +1,4 @@
const SHA3 = require('keccakjs')
const createKeccakHash = require('keccak')
const secp256k1 = require('secp256k1')
const assert = require('assert')
const rlp = require('rlp')
Expand Down Expand Up @@ -235,11 +235,7 @@ exports.sha3 = function (a, bits) {
a = exports.toBuffer(a)
if (!bits) bits = 256

var h = new SHA3(bits)
if (a) {
h.update(a)
}
return Buffer.from(h.digest('hex'), 'hex')
return createKeccakHash('keccak' + bits).update(a).digest()
}

/**
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -101,7 +101,7 @@
"dependencies": {
"bn.js": "^4.8.0",
"create-hash": "^1.1.2",
"keccakjs": "^0.2.0",
"keccak": "^1.0.2",
"rlp": "^2.0.0",
"secp256k1": "^3.0.1"
},
Expand Down

0 comments on commit 0e246cd

Please sign in to comment.