Panda3D

Loading...
Searching...
No Matches
Public Member Functions | List of all members
HashVal Class Reference

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 &copy)
vector_uchar | as_bin () const
| Returns the HashVal as a 16-byte binary string.
std::string | as_dec () const
| Returns the HashVal as a string with four decimal numbers.
std::string | as_hex () const
| Returns the HashVal as a 32-byte hexadecimal string.
int | compare_to (const HashVal &other) const
void | input_binary (std::istream &in)
| Inputs the HashVal as a binary stream of bytes in order.
void | input_dec (std::istream &in)
| Inputs the HashVal as four unsigned decimal integers.
void | input_hex (std::istream &in)
| Inputs the HashVal as a 32-digit hexadecimal number.
void | merge_with (const HashVal &other)
| Generates a new HashVal representing the xor of this one and the other one.
bool | operator!= (const HashVal &other) const
bool | operator< (const HashVal &other) const
void | operator= (const HashVal &copy)
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.
void | output_dec (std::ostream &out) const
| Outputs the HashVal as four unsigned decimal integers.
void | output_hex (std::ostream &out) const
| Outputs the HashVal as a 32-digit hexadecimal number.
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.
bool | set_from_dec (const std::string &text)
| Sets the HashVal from a string with four decimal numbers.
bool | set_from_hex (const std::string &text)
| Sets the HashVal from a 32-byte hexademical string.
void | write_datagram (Datagram &destination) const
void | write_stream (StreamWriter &destination) const

## Detailed Description

Stores a 128-bit value that represents the hashed contents (typically MD5) of a file or buffer.

Definition at line 31 of file hashVal.h.

## Constructor & Destructor Documentation

## ◆ HashVal() [1/2]

HashVal::HashVal | ( |  | ) |
| inline

Definition at line 17 of file hashVal.I.

## ◆ HashVal() [2/2]

HashVal::HashVal | ( | const HashVal & | copy | ) |
| inline

Definition at line 25 of file hashVal.I.

## Member Function Documentation

## ◆ as_bin()

vector_uchar HashVal::as_bin | ( |  | ) | const

Returns the HashVal as a 16-byte binary string.

Definition at line 152 of file hashVal.cxx.

References Datagram::get_data(), and Datagram::get_length().

## ◆ as_dec()

string HashVal::as_dec | ( |  | ) | const

Returns the HashVal as a string with four decimal numbers.

Definition at line 107 of file hashVal.cxx.

References output_dec().

## ◆ as_hex()

string HashVal::as_hex | ( |  | ) | const

Returns the HashVal as a 32-byte hexadecimal string.

Definition at line 128 of file hashVal.cxx.

## ◆ compare_to()

int HashVal::compare_to | ( | const HashVal & | other | ) | const
| inline

Definition at line 74 of file hashVal.I.

## ◆ input_binary()

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 95 of file hashVal.cxx.

References StreamReader::get_be_uint32().

## ◆ input_dec()

void HashVal::input_dec | ( | std::istream & | in | ) |
| inline

Inputs the HashVal as four unsigned decimal integers.

Definition at line 110 of file hashVal.I.

Referenced by set_from_dec().

## ◆ input_hex()

void HashVal::input_hex | ( | std::istream & | in | ) |

Inputs the HashVal as a 32-digit hexadecimal number.

Definition at line 46 of file hashVal.cxx.

Referenced by set_from_hex().

## ◆ merge_with()

void HashVal::merge_with | ( | const HashVal & | other | ) |
| inline

Generates a new HashVal representing the xor of this one and the other one.

Definition at line 91 of file hashVal.I.

## ◆ operator!=()

bool HashVal::operator!= | ( | const HashVal & | other | ) | const
| inline

Definition at line 58 of file hashVal.I.

## ◆ operator<()

bool HashVal::operator< | ( | const HashVal & | other | ) | const
| inline

Definition at line 66 of file hashVal.I.

## ◆ operator=()

void HashVal::operator= | ( | const HashVal & | copy | ) |
| inline

Definition at line 36 of file hashVal.I.

## ◆ operator==()

bool HashVal::operator== | ( | const HashVal & | other | ) | const
| inline

Definition at line 47 of file hashVal.I.

## ◆ output()

void HashVal::output | ( | std::ostream & | out | ) | const
| inline

Definition at line 118 of file hashVal.I.

## ◆ output_binary()

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 82 of file hashVal.cxx.

References StreamWriter::add_be_uint32().

## ◆ output_dec()

void HashVal::output_dec | ( | std::ostream & | out | ) | const
| inline

Outputs the HashVal as four unsigned decimal integers.

Definition at line 102 of file hashVal.I.

Referenced by as_dec().

## ◆ output_hex()

void HashVal::output_hex | ( | std::ostream & | out | ) | const

Outputs the HashVal as a 32-digit hexadecimal number.

Definition at line 33 of file hashVal.cxx.

## ◆ read_datagram()

void HashVal::read_datagram | ( | DatagramIterator & | source | ) |
| inline

Definition at line 137 of file hashVal.I.

## ◆ read_stream()

void HashVal::read_stream | ( | StreamReader & | source | ) |
| inline

Definition at line 159 of file hashVal.I.

## ◆ set_from_bin()

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 163 of file hashVal.cxx.

## ◆ set_from_dec()

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 118 of file hashVal.cxx.

References input_dec().

## ◆ set_from_hex()

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 142 of file hashVal.cxx.

References input_hex().

## ◆ write_datagram()

void HashVal::write_datagram | ( | Datagram & | destination | ) | const
| inline

Definition at line 126 of file hashVal.I.

## ◆ write_stream()

void HashVal::write_stream | ( | StreamWriter & | destination | ) | const
| inline

Definition at line 148 of file hashVal.I.

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

- panda/src/express/hashVal.h
- panda/src/express/hashVal.cxx
- panda/src/express/hashVal.I