Name: js-multihash
Owner: Multiformats
Description: multihash implementation in JavaScript
Created: 2014-05-22 22:10:15.0
Updated: 2018-01-10 18:26:35.0
Pushed: 2018-01-04 11:44:54.0
Homepage: https://github.com/multiformats/multihash
Size: 6243
Language: JavaScript
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
multihash implementation in node.js
This is the multihash implementation in Node.
<script>
tag
m install --save multihashes # node the name of the module is multihashes
Once the install is complete, you can require it as a normal dependency
t multihashes = require('multihashes')
You can require it and use with your favourite bundler to bundle this package in a browser compatible code.
<script>
tagLoading this module through a script tag will make the `Multihashes
` obj available in the global namespace.
ipt src="https://unpkg.com/multihashes/dist/index.min.js"></script>
OR -->
ipt src="https://unpkg.com/multihashes/dist/index.js"></script>
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.
r multihash = require('multihashes')
r buf = new Buffer('0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33', 'hex')
r encoded = multihash.encode(buf, 'sha1')
nsole.log(encoded)
fer 11 14 0b ee c7 b5 ea 3f 0f db c9 5d 0d d4 7f 3c 5b c2 75 da 8a 33>
ltihash.decode(encoded)
de: 17,
me: 'sha1',
ngth: 20,
gest: <Buffer 0b ee c7 b5 ea 3f 0f db c9 5d 0d d4 7f 3c 5b c2 75 da 8a 33> }
https://multiformats.github.io/js-multihash/
Captain: @diasdavid.
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.