Skip to content

Instantly share code, notes, and snippets.



Last active Aug 22, 2018
What would you like to do?
Testing SHA3 with Solidity
contract SHA3Test
function getSHA3Hash(bytes input) returns (bytes32 hashedOutput)
hashedOutput = sha3(input);
// Ethereum uses KECCAK-256. It should be noted that it does not follow
// the FIPS-202 based standard of Keccak, which was finalized in August 2015.
// Hashing the string "testing":
// Ethereum SHA3 function in Solidity = 5f16f4c7f149ac4f9510d9cf8cf384038ad348b3bcdc01915f95de12df9d1b02
// Keccak-256 (Original Padding) = 5f16f4c7f149ac4f9510d9cf8cf384038ad348b3bcdc01915f95de12df9d1b02
// SHA3-256 (NIST Standard) = 7f5979fb78f082e8b1c676635db8795c4ac6faba03525fb708cb5fd68fd40c5e
// More info:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.