hyperledger/iroha
Iroha - A simple, decentralized ledger http://iroha.tech
shared_model::crypto::Hash Class Reference

#include "hash.hpp"

Inheritance diagram for shared_model::crypto::Hash:
Inheritance graph
Collaboration diagram for shared_model::crypto::Hash:
Collaboration graph

Classes

struct  Hasher
 

Public Member Functions

 Hash ()
 
 Hash (const std::string &hash)
 
 Hash (const Blob &blob)
 
std::string toString () const override
 
- Public Member Functions inherited from shared_model::crypto::Blob
 Blob ()=default
 
 Blob (const std::string &blob)
 
 Blob (const Bytes &blob)
 
 Blob (Bytes &&blob) noexcept
 
virtual const Bytesblob () const
 
virtual const std::string & hex () const
 
virtual size_t size () const
 
bool operator== (const Blob &rhs) const override
 
- Public Member Functions inherited from shared_model::interface::ModelPrimitive< Blob >
virtual bool operator== (const ModelType &rhs) const =0
 
virtual bool operator!= (const ModelType &rhs) const
 
virtual ~ModelPrimitive ()=default
 
- Public Member Functions inherited from Cloneable< ModelPrimitive< Blob > >
virtual ~Cloneable ()=default
 

Static Public Member Functions

static Hash fromHexString (const std::string &hex)
 
- Static Public Member Functions inherited from shared_model::crypto::Blob
static Blob fromHexString (const std::string &hex)
 

Additional Inherited Members

- Public Types inherited from shared_model::crypto::Blob
using Bytes = std::vector< uint8_t >
 
- Public Types inherited from shared_model::interface::ModelPrimitive< Blob >
using ModelType = Blob
 
- Public Types inherited from Cloneable< ModelPrimitive< Blob > >
using base_type = ModelPrimitive< Blob >
 
- Protected Member Functions inherited from shared_model::crypto::Blob
Blobclone () const override
 

Detailed Description

A special class for storing hashes. Main reason to introduce it is to make difference between Hash which should represent a hashing result and a generic Blob which should represent any binary data.

Constructor & Destructor Documentation

shared_model::crypto::Hash::Hash ( )

Here is the caller graph for this function:

shared_model::crypto::Hash::Hash ( const std::string &  hash)
explicit
shared_model::crypto::Hash::Hash ( const Blob blob)
explicit

Member Function Documentation

Hash shared_model::crypto::Hash::fromHexString ( const std::string &  hex)
static

Creates new Hash object from provided hex string

Parameters
hex- string in hex format to create Hash from
Returns
Hash from provided hex string if it was correct or Hash from empty string if provided string was not a correct hex string

Here is the call graph for this function:

Here is the caller graph for this function:

std::string shared_model::crypto::Hash::toString ( ) const
overridevirtual

Make string developer representation of object

Returns
string with internal state of object

Reimplemented from shared_model::crypto::Blob.

Here is the call graph for this function:

Here is the caller graph for this function:


The documentation for this class was generated from the following files: