May I know why I can't do additional in uint for solidity 4.24?
function ToUint(bytes memory value) internal pure returns (uint) {
uint r;
for (uint i = value.length - 1; i >= 0; i--)
r = (r << 8) + uint(value[i]);
return r;
}
I might have over simplified my code and it doesn't exhibit the problem. The original code was above. As soon as I took out (r << 8) +, every thing works.
The << 8 is not an issue. Because it failed even when I have r + uint(value[I])
The length of bytes array is only 6, and all bytes value are < 0x7F