RIPEMD160
Hashing
RIPEMD-160 hash of the input, left-padded to 32 bytes.
| Address | 0x0000000000000000000000000000000000000003 |
|---|---|
| Name | RIPEMD160 |
| Minimum gas | 600 |
| Input | variable |
| Output | 32 bytes |
| Available since | Frontier |
Input
| Offset | Length | Field | Description |
|---|---|---|---|
| 0 | variable | data | Arbitrary bytes to hash. |
Output
The 20-byte RIPEMD-160 digest, left-padded to a 32-byte word.
Gas
600 + 120 × ceil(len(input) / 32)
Failure behaviour
- Cannot fail.
Notes
- Priced an order of magnitude above SHA-256 and rarely worth using on this chain.
Calling it
Precompiles have no ABI and no function selector: the input is raw bytes at the exact offsets above. Call with staticcall.
// RIPEMD160 at 0x03(bool ok, bytes memory out) = address(0x03).staticcall(input);require(ok, "RIPEMD160 reverted");