{"id":15417642,"url":"https://github.com/multiformats/js-blake2","last_synced_at":"2025-05-12T04:31:29.916Z","repository":{"id":39760060,"uuid":"305607167","full_name":"multiformats/js-blake2","owner":"multiformats","description":"BLAKE2 multihash hashers for JavaScript multiformats","archived":false,"fork":false,"pushed_at":"2025-04-28T16:00:10.000Z","size":60,"stargazers_count":3,"open_issues_count":4,"forks_count":3,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-28T17:21:36.415Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/multiformats.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-10-20T06:09:37.000Z","updated_at":"2025-04-28T16:00:12.000Z","dependencies_parsed_at":"2024-01-02T01:12:15.991Z","dependency_job_id":"28618dc7-cd2c-47ed-9463-830ce57588f9","html_url":"https://github.com/multiformats/js-blake2","commit_stats":{"total_commits":45,"total_committers":3,"mean_commits":15.0,"dds":0.5111111111111111,"last_synced_commit":"e95fe5e89addea4dd1b2ec4a497511ed61ac361a"},"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/multiformats%2Fjs-blake2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/multiformats%2Fjs-blake2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/multiformats%2Fjs-blake2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/multiformats%2Fjs-blake2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/multiformats","download_url":"https://codeload.github.com/multiformats/js-blake2/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253675272,"owners_count":21945921,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-01T17:16:39.928Z","updated_at":"2025-05-12T04:31:29.571Z","avatar_url":"https://github.com/multiformats.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @multiformats/blake2 \u003c!-- omit in toc --\u003e\n\n[![multiformats.io](https://img.shields.io/badge/project-IPFS-blue.svg?style=flat-square)](http://multiformats.io)\n[![codecov](https://img.shields.io/codecov/c/github/multiformats/js-blake2.svg?style=flat-square)](https://codecov.io/gh/multiformats/js-blake2)\n[![CI](https://img.shields.io/github/actions/workflow/status/multiformats/js-blake2/js-test-and-release.yml?branch=master\\\u0026style=flat-square)](https://github.com/multiformats/js-blake2/actions/workflows/js-test-and-release.yml?query=branch%3Amaster)\n\n\u003e Multiformats BLAKE2 implementations\n\n## Table of contents \u003c!-- omit in toc --\u003e\n\n- [Install](#install)\n- [Usage](#usage)\n- [License](#license)\n- [Contribution](#contribution)\n\n## Install\n\n```console\n$ npm i @multiformats/blake2\n```\n\n`MultihashHashers`s are exported from this library, they produce `MultihashDigest`s. Details about these can be found in the [multiformats multihash interface definitions](https://github.com/multiformats/js-multiformats/blob/master/src/hashes/interface.ts).\n\n```js\nimport * as Block from 'multiformats/block'\nimport * as codec from '@ipld/dag-cbor'\nimport { blake2b256 as hasher } from '@multiformats/blake2/blake2b'\n\nasync function run () {\n  const value = { hello: 'world' }\n  const block = await Block.encode({ value, hasher, codec })\n  console.log(block.cid)\n  // -\u003e CID(bafy2bzacedtxqx7k666ugf5mmagr2fxmbpfncbcji5jfg5uduausgb62y3av4)\n}\n\nrun().catch(console.error)\n```\n\n## Usage\n\nThe `@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`.\n\nThe `@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`.\n\ne.g. `blake2b-256`, multicodec code `0xb220`, may be imported as:\n\n```js\nimport { blake2b256 } from '@multiformats/blake2/blake2b'\n```\n\nwhile `blake2s-256`, multicodec code `0xb260`, may be imported as:\n\n```js\nimport { blake2s256 } from '@multiformats/blake2/blake2s'\n```\n\n## License\n\nLicensed under either of\n\n- Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / \u003chttp://www.apache.org/licenses/LICENSE-2.0\u003e)\n- MIT ([LICENSE-MIT](LICENSE-MIT) / \u003chttp://opensource.org/licenses/MIT\u003e)\n\n## Contribution\n\nUnless 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.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmultiformats%2Fjs-blake2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmultiformats%2Fjs-blake2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmultiformats%2Fjs-blake2/lists"}