Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@multiformats/murmur3

Package Overview
Dependencies
Maintainers
10
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@multiformats/murmur3

Multiformats Murmur3 implementations

  • 2.1.8
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
10
Created
Source

@multiformats/murmur3

multiformats.io codecov CI

Multiformats Murmur3 implementations

Table of contents

Install

$ npm i @multiformats/murmur3

MultihashHasherss are exported from this library, they produce MultihashDigests. Details about these can be found in the multiformats multihash interface definitions.

import * as Block from 'multiformats/block'
import * as codec from '@ipld/dag-cbor'
import { murmur3128 as hasher } from '@multiformats/murmur3'

async function run () {
  const value = { hello: 'world' }
  const block = await Block.encode({ value, hasher, codec })
  console.log(block.cid)
  // -> CID(bafyseebn7ksk6khsn4an2lzmae6wm4qk)
}

run().catch(console.error)

Usage

The @multiformats/murmur3 package exports murmur332 and murmur3128 MultihashHashers. The Multicodecs table defines these multihashes.

The murmur3-32, multicodec code 0x23, may be imported as:

import { murmur332 } from '@multiformats/murmur3'

The murmur3-128, multicodec code 0x22, may be imported as:

import { murmur3128 } from '@multiformats/murmur3'

The murmur3-x64-64 (which is first 64-bits of murmur3-128 used in UnixFS directory sharding), multicodec code 0x22, may be imported as:

import { murmur364 } from '@multiformats/murmur3'

License

Licensed under either of

Contribute

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Keywords

FAQs

Package last updated on 01 Jan 2024

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc