HashVal

from panda3d.core import HashVal
class HashVal

Bases:

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

Inheritance diagram

Inheritance diagram of HashVal

__eq__(other: HashVal) bool
__init__()
__init__(copy: HashVal)
__lt__(other: HashVal) bool
__ne__(other: HashVal) bool
as_bin() bytes

Returns the HashVal as a 16-byte binary string.

as_dec() str

Returns the HashVal as a string with four decimal numbers.

as_hex() str

Returns the HashVal as a 32-byte hexadecimal string.

assign(copy: HashVal) HashVal
compare_to(other: HashVal) int
hash_buffer(buffer: str, length: int)

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.

hash_bytes(data: bytes)

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.

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

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

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

hash_string(data: str)

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.

input_binary(in: istream)

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

input_dec(in: istream)

Inputs the HashVal as four unsigned decimal integers.

input_hex(in: istream)

Inputs the HashVal as a 32-digit hexadecimal number.

merge_with(other: HashVal)

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

output(out: ostream)
output_binary(out: ostream)

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

output_dec(out: ostream)

Outputs the HashVal as four unsigned decimal integers.

output_hex(out: ostream)

Outputs the HashVal as a 32-digit hexadecimal number.

read_datagram(source: DatagramIterator)
read_stream(source: StreamReader)
set_from_bin(text: bytes) bool

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

set_from_dec(text: str) bool

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

set_from_hex(text: str) bool

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

write_datagram(destination: Datagram)
write_stream(destination: StreamWriter)