Skip to content

Instantly share code, notes, and snippets.

@vkli
Created October 22, 2020 09:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vkli/7b81ca303cf64d807b2aabf2f6758e2a to your computer and use it in GitHub Desktop.
Save vkli/7b81ca303cf64d807b2aabf2f6758e2a to your computer and use it in GitHub Desktop.
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.6.6+commit.6c089d02.js&optimize=false&gist=
pragma solidity >=0.4.22 <0.7.0;
/**
* updated original from https://ethereum.github.io/browser-solidity/#gist=f50128d63b5188490fa2&optimize=false&version=soljson-v0.7.1+commit.f4a555be.js
* more info: https://github.com/vkli/Digital-Week-Online-Ethereum-Online2020
*/
contract keccak256Test
{
function getkeccak256Hash() public view returns (bytes32)
{
return keccak256("testing");
}
}
// 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:
// https://github.com/ethereum/EIPs/issues/59
// http://ethereum.stackexchange.com/questions/550/which-cryptographic-hash-function-does-ethereum-use
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment