{"id":13430298,"url":"https://github.com/multiformats/cs-multihash","last_synced_at":"2025-03-16T05:30:39.991Z","repository":{"id":66105511,"uuid":"72204457","full_name":"multiformats/cs-multihash","owner":"multiformats","description":"Multihash implementation in C#","archived":true,"fork":false,"pushed_at":"2023-05-09T09:17:10.000Z","size":200,"stargazers_count":48,"open_issues_count":0,"forks_count":15,"subscribers_count":19,"default_branch":"master","last_synced_at":"2025-03-02T22:47:30.199Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/multiformats.png","metadata":{"files":{"readme":"README.md","changelog":null,"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}},"created_at":"2016-10-28T12:12:40.000Z","updated_at":"2024-01-15T19:53:05.000Z","dependencies_parsed_at":"2024-01-05T20:52:20.274Z","dependency_job_id":null,"html_url":"https://github.com/multiformats/cs-multihash","commit_stats":null,"previous_names":["tabrath/cs-multihash"],"tags_count":29,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/multiformats%2Fcs-multihash","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/multiformats%2Fcs-multihash/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/multiformats%2Fcs-multihash/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/multiformats%2Fcs-multihash/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/multiformats","download_url":"https://codeload.github.com/multiformats/cs-multihash/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243830912,"owners_count":20354848,"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-07-31T02:00:51.961Z","updated_at":"2025-03-16T05:30:39.661Z","avatar_url":"https://github.com/multiformats.png","language":"C#","funding_links":[],"categories":["Frameworks, Libraries and Tools","框架, 库和工具"],"sub_categories":["Cryptography","密码"],"readme":"**This project is no longer maintained and has been archived.**\n\n# Multiformats.Hash (cs-multihash)\n\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[![Travis CI](https://img.shields.io/travis/multiformats/cs-multihash.svg?style=flat-square\u0026branch=master)](https://travis-ci.org/multiformats/cs-multihash)\n[![AppVeyor](https://img.shields.io/appveyor/ci/tabrath/cs-multihash/master.svg?style=flat-square)](https://ci.appveyor.com/project/tabrath/cs-multihash)\n[![NuGet](https://buildstats.info/nuget/Multiformats.Hash)](https://www.nuget.org/packages/Multiformats.Hash/)\n[![](https://img.shields.io/badge/readme%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/RichardLitt/standard-readme)\n[![Codecov](https://img.shields.io/codecov/c/github/multiformats/cs-multihash/master.svg?style=flat-square)](https://codecov.io/gh/multiformats/cs-multihash)\n[![Libraries.io](https://img.shields.io/librariesio/github/multiformats/cs-multihash.svg?style=flat-square)](https://libraries.io/github/multiformats/cs-multihash)\n\n\u003e [Multihash](https://github.com/multiformats/multihash) implementation in C# .NET Standard 1.6 compliant.\n\nThis is not a general purpose hashing library, but a library to encode/decode Multihashes which is a \"container\" describing what hash algorithm the digest is calculated with. The library also support calculating the digest, but that is not it's main purpose. If you're looking for a library that supports many algorithms and only want the raw digest, try BouncyCastle or the built-ins of the .net framework.\n\nTo be clear, when you calculate a digest (using Sum) with this library, you will get a byte array including a prefix with the properties of the algorithm used (type and length).\n\nThere's a CLI version that you can use to compute files or direct input from the command line.\nThis CLI tool passes the sharness tests [here](https://github.com/multiformats/multihash/tree/master/tests/sharness).\n\n## Table of Contents\n\n* [Install](#install)\n* [Usage](#usage)\n* [Supported hash algorithms](#supported-hash-algorithms)\n* [Maintainers](#maintainers)\n* [Contribute](#contribute)\n* [License](#license)\n\n## Install\n\n    PM\u003e Install-Package Multiformats.Hash\n\n---\n\n    dotnet add package Multiformats.Hash\n\n## Usage\n\n```csharp\n// decode a multihash formatted byte array\nMultihash mh = Multihash.Decode(bytes);\n\n// decode a multihash formatted string\nMultihash mh = Multihash.Parse(str);\nbool ok = Multihash.TryParse(str, out mh);\n\n// encode a digest to multiformat byte array\nbyte[] bytes = Multihash.Encode(digest, HashType.SHA1);\nbyte[] bytes = Multihash.Encode\u003cSHA1\u003e(digest);\n\n// calculate digest\nMultihash mh = Multihash.Sum\u003cSHA1\u003e(bytes);\n\n// verify\nbool isValid = mh.Verify(bytes);\n```\n\n## Supported hash algorithms\n\n* ID\n* MD4\n* MD5\n* SHA1\n* SHA2_256\n* SHA2_512\n* SHA3_224\n* SHA3_256\n* SHA3_384\n* SHA3_512\n* SHAKE_128\n* SHAKE_256\n* KECCAK_224\n* KECCAK_256\n* KECCAK_384\n* KECCAK_512\n* BLAKE2B-(bits) (8-512)\n* BLAKE2S-(bits) (8-256)\n* DBL_SHA2_256\n* MURMUR3_32/128\n* SKEIN256-(bits) (8-256)\n* SKEIN512-(bits) (8-512)\n* SKEIN1024-(bits) (8-1024)\n\n## Maintainers\n\nCaptain: [@tabrath](https://github.com/tabrath).\n\n## Contribute\n\nContributions welcome. Please check out [the issues](https://github.com/multiformats/cs-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## License\n\n[MIT](LICENSE) © 2017-2018 Trond Bråthen\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmultiformats%2Fcs-multihash","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmultiformats%2Fcs-multihash","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmultiformats%2Fcs-multihash/lists"}