1 #ifndef IPFS_MULTI_HASH_H_
2 #define IPFS_MULTI_HASH_H_
4 #include <vocab/byte_view.h>
9 enum class HashType { INVALID = -1, IDENTITY = 0, SHA2_256 = 0X12 };
10 constexpr std::uint16_t MaximumHashLength = 127;
12 HashType Validate(HashType);
13 std::string_view GetName(HashType);
21 explicit MultiHash(HashType, ByteView digest);
23 bool ReadPrefix(ByteView&);
26 HashType type()
const {
return type_; }
27 ByteView digest()
const {
return hash_; }
28 bool operator==(
MultiHash const&)
const =
default;
31 HashType type_ = HashType::INVALID;
32 std::vector<Byte> hash_;
Definition: multi_hash.h:17