Panda3D
Public Member Functions

HashVal Class Reference

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

List of all members.

Public Member Functions

 HashVal ()
 HashVal (HashVal const copy)
string asBin ()
 Returns the HashVal as a 16-byte binary string.
string asDec ()
 Returns the HashVal as a string with four decimal numbers.
string asHex ()
 Returns the HashVal as a 32-byte hexadecimal string.
int compareTo (HashVal const other)
 hashBuffer (string buffer, int length)
 Generates the hash value by hashing the indicated data.
bool hashFile (Filename const filename)
 Generates the hash value from the indicated file.
 hashRamfile (Ramfile const ramfile)
 Generates the hash value by hashing the indicated data.
bool hashStream (istream stream)
 Generates the hash value from the indicated file.
 hashString (string data)
 Generates the hash value by hashing the indicated data.
 inputBinary (istream in)
 Inputs the HashVal as a binary stream of bytes in order.
 inputDec (istream in)
 Inputs the HashVal as four unsigned decimal integers.
 inputHex (istream in)
 Inputs the HashVal as a 32-digit hexadecimal number.
 mergeWith (HashVal const other)
 Generates a new HashVal representing the xor of this one and the other one.
bool operator!= (HashVal const other)
bool operator< (HashVal const other)
HashVal operator= (HashVal const copy)
bool operator== (HashVal const other)
 output (ostream out)
 outputBinary (ostream out)
 Outputs the HashVal as a binary stream of bytes in order.
 outputDec (ostream out)
 Outputs the HashVal as four unsigned decimal integers.
 outputHex (ostream out)
 Outputs the HashVal as a 32-digit hexadecimal number.
 readDatagram (DatagramIterator source)
 readStream (StreamReader source)
bool setFromBin (string text)
 Sets the HashVal from a 16-byte binary string.
bool setFromDec (string text)
 Sets the HashVal from a string with four decimal numbers.
bool setFromHex (string text)
 Sets the HashVal from a 32-byte hexademical string.
 writeDatagram (Datagram destination)
 writeStream (StreamWriter destination)

Detailed Description

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


Constructor & Destructor Documentation

HashVal ( )
HashVal ( HashVal const  copy)

Member Function Documentation

string asBin ( )

Returns the HashVal as a 16-byte binary string.

string asDec ( )

Returns the HashVal as a string with four decimal numbers.

string asHex ( )

Returns the HashVal as a 32-byte hexadecimal string.

int compareTo ( HashVal const  other)
hashBuffer ( string  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.

bool hashFile ( 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.

hashRamfile ( 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 hashStream ( 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.

hashString ( string  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.

inputBinary ( istream  in)

Inputs the HashVal as a binary stream of bytes in order.

This is not the same order expected by read_stream().

inputDec ( istream  in)

Inputs the HashVal as four unsigned decimal integers.

inputHex ( istream  in)

Inputs the HashVal as a 32-digit hexadecimal number.

mergeWith ( HashVal const  other)

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

bool operator!= ( HashVal const  other)
bool operator< ( HashVal const  other)
HashVal operator= ( HashVal const  copy)
bool operator== ( HashVal const  other)
output ( ostream  out)
outputBinary ( ostream  out)

Outputs the HashVal as a binary stream of bytes in order.

This is not the same order generated by write_stream().

outputDec ( ostream  out)

Outputs the HashVal as four unsigned decimal integers.

outputHex ( ostream  out)

Outputs the HashVal as a 32-digit hexadecimal number.

readDatagram ( DatagramIterator  source)
readStream ( StreamReader  source)
bool setFromBin ( string  text)

Sets the HashVal from a 16-byte binary string.

Returns true if successful, false otherwise.

bool setFromDec ( string  text)

Sets the HashVal from a string with four decimal numbers.

Returns true if valid, false otherwise.

bool setFromHex ( string  text)

Sets the HashVal from a 32-byte hexademical string.

Returns true if successful, false otherwise.

writeDatagram ( Datagram  destination)
writeStream ( StreamWriter  destination)
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties