gleeth/crypto/keccak
Values
pub fn event_topic(signature: String) -> String
Generate event topic hash using keccak256
pub fn function_selector(
signature: String,
) -> Result(String, String)
Generate Ethereum function selector (first 4 bytes of keccak256 hash)
pub fn hash_binary_to_hex(data: BitArray) -> String
Hash binary data to hex string
pub fn keccak256_binary(data: BitArray) -> BitArray
Hash binary data using keccak256
pub fn keccak256_hex(input: String) -> String
Generate full keccak256 hash as hex string
pub fn keccak256_hex_no_prefix(input: String) -> String
Utility functions for hex output without prefix
pub fn keccak256_string(data: String) -> BitArray
Hash string data to binary using keccak256
pub fn verify_function_selector(
signature: String,
expected: String,
) -> Bool
Verify function selector matches expected value