Created
February 5, 2016 13:05
-
-
Save anonymous/a734a5d299ffa7b5a834 to your computer and use it in GitHub Desktop.
Created using soleditor: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://chriseth.github.io/browser-solidity/?gist=
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
contract ReadConvertUint256Bytes { | |
function equal(uint a) constant returns (bool) { | |
uint x = 0; | |
for (uint i = 0; i < 32; i++) { | |
uint b = uint(msg.data[35 - i]); | |
x += b * 256**i; | |
} | |
return a == x; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment