HashVal
-
class HashVal
Stores a 128-bit value that represents the hashed contents (typically MD5) of a file or buffer.
Inheritance diagram
-
HashVal(void)
-
void hash_buffer(char const *buffer, int length)
Generates the hash value by hashing the indicated data. This method is only defined if we have the OpenSSL library (which provides md5 functionality) available.
-
void hash_bytes(vector_uchar const &data)
Generates the hash value by hashing the indicated data. This method is only defined if we have the OpenSSL library (which provides md5 functionality) available.
-
bool hash_file(Filename const &filename)
Generates the hash value from the indicated file. Returns true on success, false if the file cannot be read. This method is only defined if we have the OpenSSL library (which provides md5 functionality) available.
-
void hash_ramfile(Ramfile const &ramfile)
Generates the hash value by hashing the indicated data. This method is only defined if we have the OpenSSL library (which provides md5 functionality) available.
-
bool hash_stream(std::istream &stream)
Generates the hash value from the indicated file. Returns true on success, false if the file cannot be read. This method is only defined if we have the OpenSSL library (which provides md5 functionality) available.
-
void hash_string(std::string const &data)
Generates the hash value by hashing the indicated data. This method is only defined if we have the OpenSSL library (which provides md5 functionality) available.
-
void input_binary(std::istream &in)
Inputs the
HashVal
as a binary stream of bytes in order. This is not the same order expected byread_stream()
.
-
void merge_with(HashVal const &other)
Generates a new
HashVal
representing the xor of this one and the other one.
-
void output(std::ostream &out) const
-
void output_binary(std::ostream &out) const
Outputs the
HashVal
as a binary stream of bytes in order. This is not the same order generated bywrite_stream()
.
-
void read_datagram(DatagramIterator &source)
-
void read_stream(StreamReader &source)
-
bool set_from_bin(vector_uchar const &text)
Sets the
HashVal
from a 16-byte binary string. Returns true if successful, false otherwise.
-
bool set_from_dec(std::string const &text)
Sets the
HashVal
from a string with four decimal numbers. Returns true if valid, false otherwise.
-
bool set_from_hex(std::string const &text)
Sets the
HashVal
from a 32-byte hexademical string. Returns true if successful, false otherwise.
-
void write_stream(StreamWriter &destination) const
-
HashVal(void)