Stores a 128-bit value that represents the hashed contents (typically MD5) of a file or buffer. More...
#include "hashVal.h"
Public Member Functions | |
HashVal (const HashVal ©) | |
vector_uchar | as_bin () const |
Returns the HashVal as a 16-byte binary string. More... | |
std::string | as_dec () const |
Returns the HashVal as a string with four decimal numbers. More... | |
std::string | as_hex () const |
Returns the HashVal as a 32-byte hexadecimal string. More... | |
int | compare_to (const HashVal &other) const |
void | input_binary (std::istream &in) |
Inputs the HashVal as a binary stream of bytes in order. More... | |
void | input_dec (std::istream &in) |
Inputs the HashVal as four unsigned decimal integers. More... | |
void | input_hex (std::istream &in) |
Inputs the HashVal as a 32-digit hexadecimal number. More... | |
void | merge_with (const HashVal &other) |
Generates a new HashVal representing the xor of this one and the other one. More... | |
bool | operator != (const HashVal &other) const |
bool | operator< (const HashVal &other) const |
void | operator= (const HashVal ©) |
bool | operator== (const HashVal &other) const |
void | output (std::ostream &out) const |
void | output_binary (std::ostream &out) const |
Outputs the HashVal as a binary stream of bytes in order. More... | |
void | output_dec (std::ostream &out) const |
Outputs the HashVal as four unsigned decimal integers. More... | |
void | output_hex (std::ostream &out) const |
Outputs the HashVal as a 32-digit hexadecimal number. More... | |
void | read_datagram (DatagramIterator &source) |
void | read_stream (StreamReader &source) |
bool | set_from_bin (const vector_uchar &text) |
Sets the HashVal from a 16-byte binary string. More... | |
bool | set_from_dec (const std::string &text) |
Sets the HashVal from a string with four decimal numbers. More... | |
bool | set_from_hex (const std::string &text) |
Sets the HashVal from a 32-byte hexademical string. More... | |
void | write_datagram (Datagram &destination) const |
void | write_stream (StreamWriter &destination) const |
Stores a 128-bit value that represents the hashed contents (typically MD5) of a file or buffer.
vector_uchar HashVal::as_bin | ( | ) | const |
Returns the HashVal as a 16-byte binary string.
Definition at line 153 of file hashVal.cxx.
References Datagram::get_data(), and Datagram::get_length().
string HashVal::as_dec | ( | ) | const |
Returns the HashVal as a string with four decimal numbers.
Definition at line 108 of file hashVal.cxx.
References output_dec().
string HashVal::as_hex | ( | ) | const |
Returns the HashVal as a 32-byte hexadecimal string.
Definition at line 129 of file hashVal.cxx.
void HashVal::input_binary | ( | std::istream & | in | ) |
Inputs the HashVal as a binary stream of bytes in order.
This is not the same order expected by read_stream().
Definition at line 96 of file hashVal.cxx.
References StreamReader::get_be_uint32().
|
inline |
Inputs the HashVal as four unsigned decimal integers.
Definition at line 111 of file hashVal.I.
Referenced by set_from_dec().
void HashVal::input_hex | ( | std::istream & | in | ) |
Inputs the HashVal as a 32-digit hexadecimal number.
Definition at line 47 of file hashVal.cxx.
Referenced by set_from_hex().
|
inline |
void HashVal::output_binary | ( | std::ostream & | out | ) | const |
Outputs the HashVal as a binary stream of bytes in order.
This is not the same order generated by write_stream().
Definition at line 83 of file hashVal.cxx.
References StreamWriter::add_be_uint32().
|
inline |
void HashVal::output_hex | ( | std::ostream & | out | ) | const |
Outputs the HashVal as a 32-digit hexadecimal number.
Definition at line 34 of file hashVal.cxx.
bool HashVal::set_from_bin | ( | const vector_uchar & | text | ) |
Sets the HashVal from a 16-byte binary string.
Returns true if successful, false otherwise.
Definition at line 164 of file hashVal.cxx.
bool HashVal::set_from_dec | ( | const std::string & | text | ) |
Sets the HashVal from a string with four decimal numbers.
Returns true if valid, false otherwise.
Definition at line 119 of file hashVal.cxx.
References input_dec().
bool HashVal::set_from_hex | ( | const std::string & | text | ) |
Sets the HashVal from a 32-byte hexademical string.
Returns true if successful, false otherwise.
Definition at line 143 of file hashVal.cxx.
References input_hex().