panda3d.core.HashVal

from panda3d.core import HashVal
class HashVal

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

Inheritance diagram

Inheritance diagram of HashVal

__init__() → None
__init__(copy: HashVal) → None
assign(copy: HashVal) → HashVal
Return type

HashVal

compareTo(other: HashVal) → int
mergeWith(other: HashVal) → None

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

outputDec(out: ostream) → None

Outputs the HashVal as four unsigned decimal integers.

inputDec(in: istream) → None

Inputs the HashVal as four unsigned decimal integers.

outputHex(out: ostream) → None

Outputs the HashVal as a 32-digit hexadecimal number.

inputHex(in: istream) → None

Inputs the HashVal as a 32-digit hexadecimal number.

outputBinary(out: ostream) → None

Outputs the HashVal as a binary stream of bytes in order. This is not the same order generated by writeStream().

inputBinary(in: istream) → None

Inputs the HashVal as a binary stream of bytes in order. This is not the same order expected by readStream().

output(out: ostream) → None
asDec() → str

Returns the HashVal as a string with four decimal numbers.

setFromDec(text: str) → bool

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

asHex() → str

Returns the HashVal as a 32-byte hexadecimal string.

setFromHex(text: str) → bool

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

asBin() → bytes

Returns the HashVal as a 16-byte binary string.

setFromBin(text: bytes) → bool

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

writeDatagram(destination: Datagram) → None
readDatagram(source: DatagramIterator) → None
writeStream(destination: StreamWriter) → None
readStream(source: StreamReader) → None
hashFile(filename: Filename) → bool

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.

hashStream(stream: istream) → bool

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: Ramfile) → None

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.

hashString(data: str) → None

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(data: bytes) → None

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.

hashBuffer(buffer: str, length: int) → None

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.