![]() |
VOOZH | about |
dotnet add package Nethermind.Multiformats.Hash --version 1.5.2
NuGet\Install-Package Nethermind.Multiformats.Hash -Version 1.5.2
<PackageReference Include="Nethermind.Multiformats.Hash" Version="1.5.2" />
<PackageVersion Include="Nethermind.Multiformats.Hash" Version="1.5.2" />Directory.Packages.props
<PackageReference Include="Nethermind.Multiformats.Hash" />Project file
paket add Nethermind.Multiformats.Hash --version 1.5.2
#r "nuget: Nethermind.Multiformats.Hash, 1.5.2"
#:package Nethermind.Multiformats.Hash@1.5.2
#addin nuget:?package=Nethermind.Multiformats.Hash&version=1.5.2Install as a Cake Addin
#tool nuget:?package=Nethermind.Multiformats.Hash&version=1.5.2Install as a Cake Tool
👁 Nethermind.Multiformats.Hash
Multibase implementation in C#.
This 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.
To 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).
There's a CLI version that you can use to compute files or direct input from the command line. This CLI tool passes the sharness tests here.
PM> Install-Package Multiformats.Hash
dotnet add package Multiformats.Hash
// decode a multihash formatted byte array
Multihash mh = Multihash.Decode(bytes);
// decode a multihash formatted string
Multihash mh = Multihash.Parse(str);
bool ok = Multihash.TryParse(str, out mh);
// encode a digest to multiformat byte array
byte[] bytes = Multihash.Encode(digest, HashType.SHA1);
byte[] bytes = Multihash.Encode<SHA1>(digest);
// calculate digest
Multihash mh = Multihash.Sum<SHA1>(bytes);
// verify
bool isValid = mh.Verify(bytes);
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 net8.0 is compatible. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
Showing the top 1 NuGet packages that depend on Nethermind.Multiformats.Hash:
| Package | Downloads |
|---|---|
|
Nethermind.Multiformats.Address
Multiaddr implementation in C# |
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.5.2 | 571 | 7/23/2024 |
| 1.5.2-preview.1 | 934,334 | 7/23/2024 |