AFAIK there are 3 hash functions to choose from in solidity (
ripemd). sha3 is native while the others use precompiled contracts.
Which one of these is cheapest (in terms of gas)?
keccak256 (new alias for
sha3) is cheapest.
Source: Yellow Paper
Appendix G mentions the gas cost of
Appendix E has the costs for the others.
sha256 (SHA2-256) costs:
ripemd is even more expensive: