Socket
Socket
Sign inDemoInstall

multihashes

Package Overview
Dependencies
3
Maintainers
4
Versions
51
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    multihashes

multihash implementation


Version published
Weekly downloads
374K
increased by10.56%
Maintainers
4
Install size
0.967 MB
Created
Weekly downloads
 

Readme

Source

js-multihash

Coverage Status Travis CI Dependency Status js-standard-style

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.

Lead Maintainer

David Dias

Table of Contents

Install

Using npm

> 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

const multihashes = require('multihashes')

You can require it and use with your favourite bundler to bundle this package in a browser compatible code.

Using a <script> tag

Loading this module through a script tag will make the Multihashes obj available in the global namespace.

<script src="https://unpkg.com/multihashes/dist/index.min.js"></script>
<!-- OR -->
<script src="https://unpkg.com/multihashes/dist/index.js"></script>
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.

Usage

> var multihash = require('multihashes')
> var buf = new Buffer('0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33', 'hex')

> var encoded = multihash.encode(buf, 'sha1')
> console.log(encoded)
<Buffer 11 14 0b ee c7 b5 ea 3f 0f db c9 5d 0d d4 7f 3c 5b c2 75 da 8a 33>

> multihash.decode(encoded)
{ code: 17,
  name: 'sha1',
  length: 20,
  digest: <Buffer 0b ee c7 b5 ea 3f 0f db c9 5d 0d d4 7f 3c 5b c2 75 da 8a 33> }

API

https://multiformats.github.io/js-multihash/

Contribute

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.

License

MIT © 2016 Protocol Labs Inc.

Keywords

FAQs

Last updated on 19 Jun 2020

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc