Package Exports
- js-keccak-tiny
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 (js-keccak-tiny) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
js-keccak-tiny
Keccak tiny implementation in javascript.
Install
- install library
$ npm install js-keccak-tiny
Build with emscripten
You can build keccak-tiny wasm yourself with emscripten. We build two version of keccak-tiny - node and web. The only difference is that there is no file system in web version.
$ sh build.sh
After build wasm files, you should build javascript library again.
$ npm run build
Usage
- Hash message
// for nodejs
const keccakHashAsync = require('js-keccak-tiny/dist/node-bundle')
// for browser
const keccakHashAsync = require('js-keccak-tiny/dist/browser-bundle')
const msg = Buffer.from('It works!', 'utf8')
// initialize the library
keccakTiny = await keccakHashAsync()
let hash = keccakTiny.keccak256(msg)
// do something to hash...
License
MIT