rust-multihash
rust-multihash copied to clipboard
How to get the code of a format?
From the docs I cannot find a getter for the code of any multihash code format (as in Multihash::code()).
The docs define a const for Sha3_256 but that's it.
The hashers were moved to multihash-codetable. There you can use the Code enum, from there you can e.g. get an u64 from the Code.
Though, it's recommended that you implement for your use case your own Code enum with the help of multihash-derive.