keccak
This module provides native bindings to Keccak sponge function family from Keccak Code Package. In browser pure JavaScript implementation will be used.
Usage
You can use this package as node Hash.
const createKeccakHash = require('keccak')
console.log(createKeccakHash('keccak256').digest().toString('hex'))
console.log(createKeccakHash('keccak256').update('Hello world!').digest('hex'))
Also object has two useful methods: _resetState
and _clone
const createKeccakHash = require('keccak')
console.log(createKeccakHash('keccak256').update('Hello World!')._resetState().digest('hex'))
const hash1 = createKeccakHash('keccak256').update('Hello')
const hash2 = hash1._clone()
console.log(hash1.digest('hex'))
console.log(hash1.update(' world!').digest('hex'))
console.log(hash2.update(' world!').digest('hex'))
Why I should use this package?
I thought it will be popular question, so I decide write explanation in readme.
I know a few popular packages on npm related with Keccak:
LICENSE
This library is free and open-source software released under the MIT license.