Encoded
Last updated
Last updated
Helper contract used for decoding bytes32 sample
Internal function to set a value in an encoded bytes32 using a mask and offset
This function can overflow
Parameters
encoded
bytes32
The previous encoded value
value
uint256
The value to encode
mask
uint256
The mask
offset
uint256
The offset
Returns
newEncoded
bytes32
The new encoded value
Internal function to set a bool in an encoded bytes32 using an offset
This function can overflow
Parameters
encoded
bytes32
The previous encoded value
boolean
bool
The bool to encode
offset
uint256
The offset
Returns
newEncoded
bytes32
The new encoded value
Internal function to decode a bytes32 sample using a mask and offset
This function can overflow
Parameters
encoded
bytes32
The encoded value
mask
uint256
The mask
offset
uint256
The offset
Returns
value
uint256
The decoded value
Internal function to decode a bytes32 sample into a bool using an offset
This function can overflow
Parameters
encoded
bytes32
The encoded value
offset
uint256
The offset
Returns
boolean
bool
The decoded value as a bool
Internal function to decode a bytes32 sample into a uint8 using an offset
This function can overflow
Parameters
encoded
bytes32
The encoded value
offset
uint256
The offset
Returns
value
uint8
The decoded value
Internal function to decode a bytes32 sample into a uint12 using an offset
This function can overflow
Parameters
encoded
bytes32
The encoded value
offset
uint256
The offset
Returns
value
uint16
The decoded value as a uint16, since uint12 is not supported
Internal function to decode a bytes32 sample into a uint14 using an offset
This function can overflow
Parameters
encoded
bytes32
The encoded value
offset
uint256
The offset
Returns
value
uint16
The decoded value as a uint16, since uint14 is not supported
Internal function to decode a bytes32 sample into a uint16 using an offset
This function can overflow
Parameters
encoded
bytes32
The encoded value
offset
uint256
The offset
Returns
value
uint16
The decoded value
Internal function to decode a bytes32 sample into a uint20 using an offset
This function can overflow
Parameters
encoded
bytes32
The encoded value
offset
uint256
The offset
Returns
value
uint24
The decoded value as a uint24, since uint20 is not supported
Internal function to decode a bytes32 sample into a uint24 using an offset
This function can overflow
Parameters
encoded
bytes32
The encoded value
offset
uint256
The offset
Returns
value
uint24
The decoded value
Internal function to decode a bytes32 sample into a uint40 using an offset
This function can overflow
Parameters
encoded
bytes32
The encoded value
offset
uint256
The offset
Returns
value
uint40
The decoded value
Internal function to decode a bytes32 sample into a uint64 using an offset
This function can overflow
Parameters
encoded
bytes32
The encoded value
offset
uint256
The offset
Returns
value
uint64
The decoded value
Internal function to decode a bytes32 sample into a uint128 using an offset
This function can overflow
Parameters
encoded
bytes32
The encoded value
offset
uint256
The offset
Returns
value
uint128
The decoded value