Skip to content

RIPEMD160

Hashing

RIPEMD-160 hash of the input, left-padded to 32 bytes.

Address0x0000000000000000000000000000000000000003
NameRIPEMD160
Minimum gas600
Inputvariable
Output32 bytes
Available sinceFrontier

Input

OffsetLengthFieldDescription
0variabledataArbitrary 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");