solidity-bytes-utils icon indicating copy to clipboard operation
solidity-bytes-utils copied to clipboard

`toUint24` removed?

Open OxMarco opened this issue 3 years ago • 2 comments

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;
}

OxMarco avatar Sep 12 '21 16:09 OxMarco

The function toUint24 is needed sometimes.

gzliudan avatar Dec 28 '21 01:12 gzliudan

nice

krishan1908 avatar Jan 02 '23 18:01 krishan1908