multihash implementation
npm install @sotatek-anhdao/bsw-multihashes




> multihash implementation in node.js
This is the multihash implementation in Node.
It is extended by js-multihashing
and js-multihashing-async,
so give those a look as well.
- Install
- Using npm
- Using a tag
- Usage
- API
- Update Constants
- Contribute
- License
``bash`
> npm install multihashes # NOTE: The name of the module is multihashes!
Loading this module through a script tag will make the Multihashes obj available in the global namespace.
`html`
`js
> var multihash = require('multihashes')
> var bytes = Uint8Array.from([0, 1, 2, 3...])
> var encoded = multihash.encode(bytes, 'sha1')
> console.log(encoded)
> multihash.decode(encoded)
{ code: 17,
name: 'sha1',
length: 20,
digest:
`
https://multiformats.github.io/js-multihash/
To update the constants table run the command below. This will fetch the main codec list from https://raw.githubusercontent.com/multiformats/multicodec/master/table.csv and filter only the multihash codecs and update the constants.js file in this repo.
`sh``
npm run update-constants
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.