# @multiformats/blake2

> Multiformats BLAKE2 implementations

Latest version **2.0.3** (published 2026-07-03) · Apache-2.0 OR MIT license · 0 weekly downloads

## Install

```sh
npm install @multiformats/blake2
pnpm add @multiformats/blake2
yarn add @multiformats/blake2
bun add @multiformats/blake2
```

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; has provenance; recently updated; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 2.0.3 |
| Published | 2026-07-03 |
| First published | 2020-10-24 |
| Weekly downloads | 0 |
| License | Apache-2.0 OR MIT |
| TypeScript types | bundled |
| Module format | ESM |
| Dependencies | 2 |
| Unpacked size | 243.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 4 |
| Author | Rod Vagg |
| Maintainers | daviddias, vmx, mikeal, hugomrdias, alanshaw, achingbrain, vascosantos, rvagg, lidel, npm-service-account-multiformats |
| Keywords | blake2, hash, ipfs, ipld, multiformats, multihash |

## Links

- npm: https://www.npmjs.com/package/@multiformats/blake2
- Repository: https://github.com/multiformats/js-blake2
- Homepage: https://github.com/multiformats/js-blake2#readme
- Issues: https://github.com/multiformats/js-blake2/issues
- npm.io page: https://npm.io/package/@multiformats/blake2

## Dependencies (2)

- [blakejs](https://npm.io/package/blakejs.md) ^1.2.1
- [multiformats](https://npm.io/package/multiformats.md) ^14.0.3

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 2.0.3 (latest) — 2026-07-03
- 2.0.2 — 2024-01-02
- 2.0.1 — 2023-10-03
- 2.0.0 — 2023-08-31
- 1.0.13 — 2023-01-06
- 1.0.12 — 2022-12-09
- 1.0.11 — 2022-08-26
- 1.0.10 — 2022-05-26
- 1.0.9 — 2022-03-02
- 1.0.8 — 2021-12-10
- 1.0.7 — 2021-12-10
- 1.0.6 — 2021-09-28
- 1.0.5 — 2021-08-06
- 1.0.4 — 2021-08-05
- 1.0.3 — 2021-08-04
- … 5 more at https://npm.io/package/@multiformats/blake2/versions

## README

# @multiformats/blake2

[![multiformats.io](https://img.shields.io/badge/project-IPFS-blue.svg?style=flat-square)](http://multiformats.io)
[![codecov](https://img.shields.io/codecov/c/github/multiformats/js-blake2.svg?style=flat-square)](https://codecov.io/gh/multiformats/js-blake2)
[![CI](https://img.shields.io/github/actions/workflow/status/multiformats/js-blake2/js-test-and-release.yml?branch=master\&style=flat-square)](https://github.com/multiformats/js-blake2/actions/workflows/js-test-and-release.yml?query=branch%3Amaster)

> Multiformats BLAKE2 implementations

# About

<!--

!IMPORTANT!

Everything in this README between "# About" and "# Install" is automatically
generated and will be overwritten the next time the doc generator is run.

To make changes to this section, please update the @packageDocumentation section
of src/index.js or src/index.ts

To experiment with formatting, please run "npm run docs" from the root of this
repo and examine the changes made.

-->

The `@multiformats/blake2/blake2b` package exports `blake2bX` `MultihashHasher`s, where `X` is the output length in bits. The Multicodecs [table](https://github.com/multiformats/multicodec/blob/master/table.csv) defines 64 different output lengths for **BLAKE2b**, from `8` to `512`.

The `@multiformats/blake2/blake2s` package exports `blake2sX` `MultihashHasher`s, where `X` is the output length in bits. For **BLAKE2s**, there are 32 different output lengths, from `8` to `256`.

e.g. `blake2b-256`, multicodec code `0xb220`, may be imported as:

```ts
import { blake2b256 } from '@multiformats/blake2/blake2b'
```

while `blake2s-256`, multicodec code `0xb260`, may be imported as:

```ts
import { blake2s256 } from '@multiformats/blake2/blake2s'
```

## Example

```ts
import * as codec from '@ipld/dag-cbor'
import * as Block from 'multiformats/block'
import { blake2b256 as hasher } from './src/blake2b.js' // would be: '@multiformats/blake2/blake2b'

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

run().catch(console.error)
```

# Install

```console
$ npm i @multiformats/blake2
```

## Browser `<script>` tag

Loading this module through a script tag will make its exports available as `MultiformatsBlake2` in the global namespace.

```html
<script src="https://unpkg.com/@multiformats/blake2/dist/index.min.js"></script>
```

# API Docs

- <https://multiformats.github.io/js-blake2>

# License

Licensed under either of

- Apache 2.0, ([LICENSE-APACHE](https://github.com/multiformats/js-blake2/LICENSE-APACHE) / <http://www.apache.org/licenses/LICENSE-2.0>)
- MIT ([LICENSE-MIT](https://github.com/multiformats/js-blake2/LICENSE-MIT) / <http://opensource.org/licenses/MIT>)

# Contribution

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.

---
_Source: https://npm.io/package/@multiformats/blake2 · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
