solidity-bytes-utils
solidity-bytes-utils copied to clipboard
`toUint24` removed?
Why was the "toUint24" method removed?
Here is the rather simple code to implement it:
function toUint24(bytes memory _bytes, uint256 _start) internal pure returns (uint24) {
require(_bytes.length >= _start + 3, "toUint24_outOfBounds");
uint24 tempUint;
assembly {
tempUint := mload(add(add(_bytes, 0x3), _start))
}
return tempUint;
}
The function toUint24 is needed sometimes.
nice