multiple hash functions
npm install multihashing-async⛔️ DEPRECATED: This module has been superseded by the multiformats module





> Use all the functions in multihash.
callbacks and released under >0.6.0 <0.7.0.#### Wait, why, how is this different from Node crypto?
This module just makes working with multihashes a bit nicer.
js-multihash is only for
encoding/decoding multihashes, and does not depend on other libs.
This module will depend on various implementations for each hash.
It currently uses crypto and sha3 in Node.js.
In the browser webcrypto
and browserify-sha3 are used.
- Install
- In Node.js through npm
- Use in a browser with browserify, webpack or any other bundler
- Use in a browser Using a script tag
- Usage
- Examples
- Multihash output
- API
- Contribute
- License
``bash`
$ npm install --save multihashing-async
`js`
const multihashing = require('multihashing-async')
The code published to npm that gets loaded on require is in fact a ES5 transpiled
version with the right shims added. This means that you can require it and use with
your favourite bundler without having to adjust asset management process.
`js`
const multihashing = require('multihashing-async')
Loading this module through a script tag will make the multihashing obj
available in the global namespace.
`html`
`js
const multihashing = require('multihashing-async')
const bytes = new TextEncoder().encode('beep boop')
const mh = await multihashing(bytes, 'sha1')
// Use .digest(...) if you want only the hash digest (drops the prefix indicating the hash type).
const digest = await multihashing.digest(bytes, 'sha1')
// Use .createHash(...) for the raw hash functions`
const hash = multihashing.createHash('sha1')
const digest = await hash(bytes)
`js
const multihashing = require('multihashing-async')
const bytes = new TextEncoder().encode('beep boop')
const mh = await multihashing(bytes, 'sha1')
console.log(mh)
// =>
const mh = await multihashing(bytes, 'sha2-256')
console.log(mh)
// =>
const mh = await multihashing(bytes, 'sha2-512')
console.log(mh)
// =>
``
https://multiformats.github.io/js-multihashing-async/
Contributions welcome. Please check out the issues.
Check out our contributing document for more information on how we work, and about contributing in general. Please be aware that all interactions related to multiformats are subject to the IPFS Code of Conduct.
Small note: If editing the README, please conform to the standard-readme specification.
MIT © Protocol Labs Inc.