Socket
Socket
Sign inDemoInstall

multihashes

Package Overview
Dependencies
5
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
371K
decreased by-4.44%
Maintainers
4
Install size
628 kB
Created
Weekly downloads
 

Readme

Source

js-multihash

codecov GitHub Workflow Status

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

Hugo Dias

Table of Contents

Install

Using npm

> npm install multihashes # NOTE: The name of the module is multihashes!

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>

Usage

> var multihash = require('multihashes')
> var bytes = Uint8Array.from([0, 1, 2, 3...])

> var encoded = multihash.encode(bytes, 'sha1')
> console.log(encoded)
<Uint8Array 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: <Uint8Array 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/

Update Constants

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.

npm run update-constants

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 © Protocol Labs Inc.

Keywords

FAQs

Last updated on 24 Aug 2021

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