alloy_primitives::utils

Function eip191_hash_message

Source
pub fn eip191_hash_message<T: AsRef<[u8]>>(message: T) -> B256
Expand description

Hash a message according to EIP-191 (version 0x01).

The final message is a UTF-8 string, encoded as follows: "\x19Ethereum Signed Message:\n" + message.length + message

This message is then hashed using Keccak-256.