Text, hex, and EVM words
keccak256 accepts both text-oriented and binary-oriented overloads. A VARCHAR beginning with 0x is treated as hex bytes, while other VARCHAR input is hashed as UTF-8.
- Use keccak256('hello') for UTF-8 text.
- Use keccak256('0x68656c6c6f') for hex encoded bytes.
- Use keccak256(blob_value) when the bytes are already binary.
- Do not use the VARCHAR overload when a 0x-prefixed string must be hashed as literal text.
- Use explicit ADDRESS::BYTES32 and UINT256 casts when computing Solidity mapping slots.
Local SQL
Local SQL