Keccak-256 Hash
Calculate Keccak-256 cryptographic hash (used in Ethereum)
1. What is Keccak-256?
Keccak-256 is a cryptographic hash function that is part of the SHA-3 family. It is widely used in Ethereum for various purposes including creating addresses, signing transactions, and generating function selectors.
2. How does it work?
How is the hash calculated?
Keccak-256 processes input data through a series of permutation rounds using a sponge construction. The input is absorbed into the state through XOR operations, then transformed through multiple rounds of mixing operations (theta, rho, pi, chi, and iota). Finally, the hash is squeezed out as a 256-bit (32-byte) output. The algorithm ensures that even tiny changes in input produce completely different hash values, making it ideal for cryptographic applications in blockchain technology.
3. Examples
Hash a string
Hello, World!
→ 0xacaf3289d7b601cbd114fb36c4d29c85bbfd5e133f14cb355c3fd8d99367964fHash a function signature
transfer(address,uint256)
→ 0xa9059cbb2ab09eb219583f4a59a5d0623ade346d962bcd4e46b11da047c9049bHash hexadecimal data
0xdeadbeef
→ 0xd4fd4e189132273036449fc9e11198c739161b4c0116a9a2dccdfa1c492006f1