{"id":13558366,"url":"https://github.com/multiformats/rust-multihash","last_synced_at":"2025-05-14T15:04:30.248Z","repository":{"id":3191965,"uuid":"48695369","full_name":"multiformats/rust-multihash","owner":"multiformats","description":"multihash implementation in Rust","archived":false,"fork":false,"pushed_at":"2025-04-28T23:39:00.000Z","size":2859,"stargazers_count":161,"open_issues_count":8,"forks_count":63,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-04-29T00:38:27.057Z","etag":null,"topics":["hash","hash-algorithm","ipfs","multiformats","rust"],"latest_commit_sha":null,"homepage":"https://github.com/multiformats/multihash","language":"Rust","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":"2015-12-28T14:06:19.000Z","updated_at":"2025-04-28T23:38:29.000Z","dependencies_parsed_at":"2023-02-16T16:32:19.446Z","dependency_job_id":"68f7d361-7d00-40cb-b6ff-a2cf30532f62","html_url":"https://github.com/multiformats/rust-multihash","commit_stats":{"total_commits":355,"total_committers":38,"mean_commits":9.342105263157896,"dds":0.5943661971830986,"last_synced_commit":"90a6c19ec71ced09469eec164a3586aafeddfbbd"},"previous_names":[],"tags_count":52,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/multiformats%2Frust-multihash","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/multiformats%2Frust-multihash/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/multiformats%2Frust-multihash/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/multiformats%2Frust-multihash/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/multiformats","download_url":"https://codeload.github.com/multiformats/rust-multihash/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254168703,"owners_count":22026206,"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":["hash","hash-algorithm","ipfs","multiformats","rust"],"created_at":"2024-08-01T12:04:54.834Z","updated_at":"2025-05-14T15:04:30.226Z","avatar_url":"https://github.com/multiformats.png","language":"Rust","readme":"# rust-multihash\n\n[![](https://img.shields.io/badge/made%20by-Protocol%20Labs-blue.svg?style=flat-square)](http://ipn.io)\n[![](https://img.shields.io/badge/project-multiformats-blue.svg?style=flat-square)](https://github.com/multiformats/multiformats)\n[![](https://img.shields.io/badge/freenode-%23ipfs-blue.svg?style=flat-square)](https://webchat.freenode.net/?channels=%23ipfs)\n[![](https://img.shields.io/badge/readme%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/RichardLitt/standard-readme)\n\n[![Build Status](https://github.com/multiformats/rust-multihash/workflows/build/badge.svg)](https://github.com/multiformats/rust-multihash/actions)\n[![Crates.io](https://img.shields.io/crates/v/multihash?style=flat-square)](https://crates.io/crates/multihash)\n[![License](https://img.shields.io/crates/l/multihash?style=flat-square)](LICENSE)\n[![Documentation](https://docs.rs/multihash/badge.svg?style=flat-square)](https://docs.rs/multihash)\n[![Dependency Status](https://deps.rs/repo/github/multiformats/rust-multihash/status.svg)](https://deps.rs/repo/github/multiformats/rust-multihash)\n[![Coverage Status]( https://img.shields.io/codecov/c/github/multiformats/rust-multihash?style=flat-square)](https://codecov.io/gh/multiformats/rust-multihash)\n\n\u003e [multihash](https://github.com/multiformats/multihash) implementation in Rust.\n\n## Table of Contents\n  - [Install](#install)\n  - [Usage](#usage)\n  - [Supported Hash Types](#supported-hash-types)\n  - [Maintainers](#maintainers)\n  - [Contribute](#contribute)\n  - [License](#license)\n\n## Install\n\nFirst add this to your `Cargo.toml`\n\n```toml\n[dependencies]\nmultihash = \"*\"\n```\n\nThen run `cargo build`.\n\n## MSRV\n\nThe minimum supported Rust version for this library is `1.64.0`.\nThis is only guaranteed without additional features activated.\n\n## Usage\n\nThe `multihash` crate exposes a basic data structure for encoding and decoding multihash.\nIt does not provide any hashing functionality itself.\n`Multihash` uses const-generics to define the internal buffer size.\nYou should set this to the maximum size of the digest you want to support.\n\n```rust\nuse multihash::Multihash;\n\nconst SHA2_256: u64 = 0x12;\n\nfn main() {\n\tlet hash = Multihash::\u003c64\u003e::wrap(SHA2_256, b\"my digest\");\n\tprintln!(\"{:?}\", hash);\n}\n```\n\n### Using a custom code table\n\nYou can derive your own application specific code table using the `multihash-derive` crate.\nThe `multihash-codetable` provides predefined hasher implementations if you don't want to implement your own.\n\n```rust\nuse multihash_derive::MultihashDigest;\n\n#[derive(Clone, Copy, Debug, Eq, MultihashDigest, PartialEq)]\n#[mh(alloc_size = 64)]\npub enum Code {\n    #[mh(code = 0x01, hasher = multihash_codetable::Sha2_256)]\n    Foo,\n    #[mh(code = 0x02, hasher = multihash_codetable::Sha2_512)]\n    Bar,\n}\n\nfn main() {\n    let hash = Code::Foo.digest(b\"my hash\");\n    println!(\"{:02x?}\", hash);\n}\n```\n\n## Supported Hash Types\n\n* `SHA1`\n* `SHA2-256`\n* `SHA2-512`\n* `SHA3`/`Keccak`\n* `Blake2b-256`/`Blake2b-512`/`Blake2s-128`/`Blake2s-256`\n* `Blake3`\n* `Strobe`\n\n## Maintainers\n\nCaptain: [@dignifiedquire](https://github.com/dignifiedquire).\n\n## Contribute\n\nContributions welcome. Please check out [the issues](https://github.com/multiformats/rust-multihash/issues).\n\nCheck out our [contributing document](https://github.com/multiformats/multiformats/blob/master/contributing.md) 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](https://github.com/ipfs/community/blob/master/code-of-conduct.md).\n\nSmall note: If editing the README, please conform to the [standard-readme](https://github.com/RichardLitt/standard-readme) specification.\n\n\n## License\n\n[MIT](LICENSE)\n","funding_links":[],"categories":["Rust","ipfs"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmultiformats%2Frust-multihash","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmultiformats%2Frust-multihash","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmultiformats%2Frust-multihash/lists"}