Skip to content

Instantly share code, notes, and snippets.

Created February 5, 2016 13:05
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 anonymous/a734a5d299ffa7b5a834 to your computer and use it in GitHub Desktop.
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=
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