Panda3D
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Properties
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...

Public Member Functions

 __init__ ()
 
 __init__ (const HashVal copy)
 
str asBin ()
 Returns the HashVal as a 16-byte binary string. More...
 
str asDec ()
 Returns the HashVal as a string with four decimal numbers. More...
 
str asHex ()
 Returns the HashVal as a 32-byte hexadecimal string. More...
 
int compareTo (const HashVal other)
 
 hashBuffer (str 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. More...
 
bool hashFile (const Filename 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. More...
 
 hashRamfile (const Ramfile 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. More...
 
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. More...
 
 hashString (str 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. More...
 
 inputBinary (Istream in)
 Inputs the HashVal as a binary stream of bytes in order. This is not the same order expected by read_stream(). More...
 
 inputDec (Istream in)
 Inputs the HashVal as four unsigned decimal integers. More...
 
 inputHex (Istream in)
 Inputs the HashVal as a 32-digit hexadecimal number. More...
 
 mergeWith (const HashVal other)
 Generates a new HashVal representing the xor of this one and the other one. More...
 
bool operator!= (const HashVal other)
 
bool operator< (const HashVal other)
 
HashVal operator= (const HashVal copy)
 
bool operator== (const HashVal 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(). More...
 
 outputDec (Ostream out)
 Outputs the HashVal as four unsigned decimal integers. More...
 
 outputHex (Ostream out)
 Outputs the HashVal as a 32-digit hexadecimal number. More...
 
 readDatagram (DatagramIterator source)
 
 readStream (StreamReader source)
 
bool setFromBin (str text)
 Sets the HashVal from a 16-byte binary string. Returns true if successful, false otherwise. More...
 
bool setFromDec (str text)
 Sets the HashVal from a string with four decimal numbers. Returns true if valid, false otherwise. More...
 
bool setFromHex (str text)
 Sets the HashVal from a 32-byte hexademical string. Returns true if successful, false otherwise. More...
 
 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.

Member Function Documentation

__init__ ( )
__init__ ( const HashVal  copy)
str asBin ( )

Returns the HashVal as a 16-byte binary string.

str asDec ( )

Returns the HashVal as a string with four decimal numbers.

str asHex ( )

Returns the HashVal as a 32-byte hexadecimal string.

int compareTo ( const HashVal  other)
hashBuffer ( str  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 ( const Filename  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 ( const Ramfile  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 ( str  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 ( const HashVal  other)

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

bool operator!= ( const HashVal  other)
bool operator< ( const HashVal  other)
HashVal operator= ( const HashVal  copy)
bool operator== ( const HashVal  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 ( str  text)

Sets the HashVal from a 16-byte binary string. Returns true if successful, false otherwise.

bool setFromDec ( str  text)

Sets the HashVal from a string with four decimal numbers. Returns true if valid, false otherwise.

bool setFromHex ( str  text)

Sets the HashVal from a 32-byte hexademical string. Returns true if successful, false otherwise.

writeDatagram ( Datagram  destination)
writeStream ( StreamWriter  destination)