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

Public Member Functions

 __init__ ()
 
 __init__ (const HashVal copy)
 
VectorUchar 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. More...
 
 hashBytes (VectorUchar data)
 Generates the hash value by hashing the indicated data. More...
 
bool hashFile (const Filename filename)
 Generates the hash value from the indicated file. More...
 
 hashRamfile (const Ramfile ramfile)
 Generates the hash value by hashing the indicated data. More...
 
bool hashStream (Istream stream)
 Generates the hash value from the indicated file. More...
 
 hashString (str data)
 Generates the hash value by hashing the indicated data. More...
 
 inputBinary (Istream in)
 Inputs the HashVal as a binary stream of bytes in order. 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. 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 (VectorUchar text)
 Sets the HashVal from a 16-byte binary string. More...
 
bool setFromDec (str text)
 Sets the HashVal from a string with four decimal numbers. More...
 
bool setFromHex (str text)
 Sets the HashVal from a 32-byte hexademical string. 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__() [1/2]

__init__ ( )

◆ __init__() [2/2]

__init__ ( const HashVal  copy)

◆ asBin()

VectorUchar asBin ( )

Returns the HashVal as a 16-byte binary string.

◆ asDec()

str asDec ( )

Returns the HashVal as a string with four decimal numbers.

◆ asHex()

str asHex ( )

Returns the HashVal as a 32-byte hexadecimal string.

◆ compareTo()

int compareTo ( const HashVal  other)

◆ hashBuffer()

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.

◆ hashBytes()

hashBytes ( VectorUchar  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.

◆ hashFile()

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()

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.

◆ hashStream()

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()

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()

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()

inputDec ( Istream  in)

Inputs the HashVal as four unsigned decimal integers.

◆ inputHex()

inputHex ( Istream  in)

Inputs the HashVal as a 32-digit hexadecimal number.

◆ mergeWith()

mergeWith ( const HashVal  other)

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

◆ operator !=()

bool operator != ( const HashVal  other)

◆ operator<()

bool operator< ( const HashVal  other)

◆ operator=()

HashVal operator= ( const HashVal  copy)

◆ operator==()

bool operator== ( const HashVal  other)

◆ output()

output ( Ostream  out)

◆ outputBinary()

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()

outputDec ( Ostream  out)

Outputs the HashVal as four unsigned decimal integers.

◆ outputHex()

outputHex ( Ostream  out)

Outputs the HashVal as a 32-digit hexadecimal number.

◆ readDatagram()

readDatagram ( DatagramIterator  source)

◆ readStream()

readStream ( StreamReader  source)

◆ setFromBin()

bool setFromBin ( VectorUchar  text)

Sets the HashVal from a 16-byte binary string.

Returns true if successful, false otherwise.

◆ setFromDec()

bool setFromDec ( str  text)

Sets the HashVal from a string with four decimal numbers.

Returns true if valid, false otherwise.

◆ setFromHex()

bool setFromHex ( str  text)

Sets the HashVal from a 32-byte hexademical string.

Returns true if successful, false otherwise.

◆ writeDatagram()

writeDatagram ( Datagram  destination)

◆ writeStream()

writeStream ( StreamWriter  destination)