Panda3D

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. 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 &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. 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

## 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.

## 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.

## ◆ 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.

## ◆ 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.

## ◆ 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.

## ◆ 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().

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