Hash (Class)¶
A 32-byte hash value.
Used for transaction IDs, block hashes, and other cryptographic purposes.
__new__
¶
__new__(hex_str: str) -> Hash
Create a new Hash from a hex string.
| PARAMETER | DESCRIPTION |
|---|---|
hex_str
|
A 64-character hex string representing the hash.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Hash
|
A new Hash instance.
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
Exception
|
If the hex string is invalid. |
__str__
¶
The string representation.
| RETURNS | DESCRIPTION |
|---|---|
str
|
The Hash as a hex string
TYPE:
|
to_string
¶
Convert the hash to a hex string.
| RETURNS | DESCRIPTION |
|---|---|
str
|
A 64-character hex string.
TYPE:
|