multihash implementation
js-multihash
============









> multihash implementation in node.js
This is the multihash implementation in Node.
- Install
- In Node.js through npm
- Browser: Browserify, Webpack, other bundlers
- In the Browser through tag
- Gotchas
- Usage
- API
- Contribute
- License
``bash`
> npm install --save multihashes # node the name of the module is multihashes
Once the install is complete, you can require it as a normal dependency
`js`
const multihashes = require('multihashes')
You can require it and use with your favourite bundler to bundle this package in a browser compatible code.
Loading this module through a script tag will make the `Multihashes` obj available in the global namespace.
``
#### Gotchas
You will need to use Node.js Buffer API compatible, if you are running inside the browser, you can access it by multihash.Buffer or you can install Feross's Buffer.
`js
> var multihash = require('multihashes')
> var buf = new Buffer('0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33', 'hex')
> var encoded = multihash.encode(buf, 'sha1')
> console.log(encoded)
> multihash.decode(encoded)
{ code: 17,
name: 'sha1',
length: 20,
digest:
``
https://multiformats.github.io/js-multihash/
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 © 2016 Protocol Labs Inc.