[Ethereum] How to compare msg.data (calldata) data type to an integer data type uint256

abicalldatacontract-developmentsolidity

As per my question here:

I need to compare msg.data (specifically, numbers that are sent with the sendTransaction data object) to a data type of uint256 within my contract.

How is this possible?

Best Answer

Byte-per-byte comparisons. Conversions needed. reddit link is dead. Why do you need to access msg.data directly?

EDIT: Convert a uint256 from calldata bytes to a proper uint256 in Solidity: https://gist.github.com/anonymous/a734a5d299ffa7b5a834

EDIT: The typing system and posting rules on this site are super weird. Anyways that works. It should always return true.