JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 4290
  • Score
    100M100P100Q116138F
  • License MIT

Keccak hash (SHA3) in Node.js and in the browser. Fast & simple.

Package Exports

  • keccakjs

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (keccakjs) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Keccak.js

The only Keccak hash (aka SHA3 before standardisation) library you need in Javascript. Ever. Pinky promise!

It is a meta package and lets you to use node-sha3 or js-sha3 with the same interface on your choice of deployment. It uses browserify-sha3 to do the mapping for you.

There's no speed loss, it is as thin as it can get (but there is some twiddling in package.json to select the right package for your environment):

module.exports = require('sha3').SHA3Hash

Example usage:

const keccak = require('keccakjs')

var hash = new keccak() // uses 512 bits by default
hash.update('hello')
hash.update(Buffer.from('42004200', 'hex'))
hash.digest() // binary output
hash.digest('hex') // hex output

NOTE: This library supports the Keccak padding only - and not the final SHA3 padding.