hyperledger/iroha
Iroha - A simple, decentralized ledger http://iroha.tech
hash.hpp
Go to the documentation of this file.
1 
6 #ifndef IROHA_SHARED_MODEL_HASH_HPP
7 #define IROHA_SHARED_MODEL_HASH_HPP
8 
9 #include "cryptography/blob.hpp"
10 
11 namespace shared_model {
12  namespace crypto {
18  class Hash : public Blob {
19  public:
23  struct Hasher {
24  std::size_t operator()(Hash const &h) const;
25  };
26 
27  Hash();
28 
29  explicit Hash(const std::string &hash);
30  explicit Hash(std::string_view hash);
31  explicit Hash(const char *hash);
32 
33  explicit Hash(const Blob &blob);
34 
41  static Hash fromHexString(const std::string &hex);
42 
43  std::string toString() const override;
44  };
45  } // namespace crypto
46 } // namespace shared_model
47 
48 #endif // IROHA_SHARED_MODEL_HASH_HPP
Definition: hash.hpp:18
std::size_t operator()(Hash const &h) const
Definition: hash.cpp:33
Hash()
Definition: hash.cpp:14
Definition: blob.hpp:27
std::string toString() const override
Definition: hash.cpp:26
virtual const Bytes & blob() const
Definition: blob.cpp:50
virtual const std::string & hex() const
Definition: blob.cpp:58
hash256_t hash(const T &pb)
Definition: pb_common.hpp:43
Definition: command_executor.hpp:13
Definition: hash.hpp:23
static Hash fromHexString(const std::string &hex)
Definition: hash.cpp:22