cchecksum
A ~2x faster drop-in replacement for eth_utils.to_checksum_address. Raises the exact same Exceptions. Implemented in C.
- cchecksum.to_checksum_address(value)[source]
Convert an address to its EIP-55 checksum format.
This function takes an address in any supported format and returns it in the checksummed format as defined by EIP-55. It uses a custom Cython implementation for the checksum conversion to optimize performance.
- Args:
- value: The address to be converted. It can be in any format supported by
eth_utils.to_normalized_address()
.
- Raises:
ValueError: If the input address is not in a recognized format. TypeError: If the input is not a string, bytes, or any address type.
- Examples:
>>> to_checksum_address("0xb47e3cd837ddf8e4c57f05d70ab865de6e193bbb") '0xb47e3cd837dDF8e4c57F05d70Ab865de6e193BBB'
>>> to_checksum_address(b'´~<Ø7ÝøäÅ×
- ¸eÞn;»’)
‘0xb47e3cd837dDF8e4c57F05d70Ab865de6e193BBB’
- See Also:
eth_utils.to_checksum_address()
for the standard implementation.to_normalized_address()
for converting to a normalized address before checksumming.
- Parameters:
value (AnyAddress | str | bytes)
- Return type: