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()(const Hash &h) const;
25  };
26 
27  Hash();
28 
29  explicit Hash(const std::string &hash);
30 
31  explicit Hash(const Blob &blob);
32 
39  static Hash fromHexString(const std::string &hex);
40 
41  std::string toString() const override;
42  };
43  } // namespace crypto
44 } // namespace shared_model
45 
46 #endif // IROHA_SHARED_MODEL_HASH_HPP
Definition: hash.hpp:18
std::size_t operator()(const Hash &h) const
Definition: hash.cpp:31
Hash()
Definition: hash.cpp:14
Definition: blob.hpp:24
std::string toString() const override
Definition: hash.cpp:24
virtual const std::string & hex() const
Definition: blob.cpp:45
hash256_t hash(const T &pb)
Definition: pb_common.hpp:43
virtual const Bytes & blob() const
Definition: blob.cpp:41
Definition: command_executor.hpp:12
Definition: hash.hpp:23
static Hash fromHexString(const std::string &hex)
Definition: hash.cpp:20