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, std::size_t length)
Generates the hash value by hashing the indicated data.
-
void hash_bytes(vector_uchar const &data)
Generates the hash value by hashing the indicated data.
-
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.
-
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.
-
void hash_string(std::string_view data)
Generates the hash value by hashing the indicated data.
-
void input_binary(std::istream &in)
Inputs the
HashValas 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
HashValrepresenting the xor of this one and the other one.
-
void output(std::ostream &out) const
-
void output_binary(std::ostream &out) const
Outputs the
HashValas 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
HashValfrom a 16-byte binary string. Returns true if successful, false otherwise.
-
bool set_from_dec(std::string const &text)
Sets the
HashValfrom a string with four decimal numbers. Returns true if valid, false otherwise.
-
bool set_from_hex(std::string const &text)
Sets the
HashValfrom a 32-byte hexademical string. Returns true if successful, false otherwise.
-
void write_stream(StreamWriter &destination) const
-
HashVal(void)
