Bytes32Helper
Constants
_INDEX_OUT_OF_BOUNDS_SELECTOR
bytes4 private constant _INDEX_OUT_OF_BOUNDS_SELECTOR = 0x4e23d035;Functions
eq
Returns whether two values are equal.
function eq(bytes32 a, bytes32 b) external pure returns (bool);Parameters
| Name | Type | Description |
|---|---|---|
| a | bytes32 | |
| b | bytes32 |
Returns
| Name | Type | Description |
|---|---|---|
| <none> | bool |
ternary
Ternary evaluation for bytes32 type.
function ternary(bool condition, bytes32 a, bytes32 b) external pure returns (bytes32);Parameters
| Name | Type | Description |
|---|---|---|
| condition | bool | |
| a | bytes32 | |
| b | bytes32 |
Returns
| Name | Type | Description |
|---|---|---|
| <none> | bytes32 |
arrayOf
Returns an array from the two given values.
function arrayOf(bytes32 a, bytes32 b) external pure returns (bytes32[] memory);Parameters
| Name | Type | Description |
|---|---|---|
| a | bytes32 | |
| b | bytes32 |
Returns
| Name | Type | Description |
|---|---|---|
| <none> | bytes32[] |
getTupleWord
Returns the 32-byte word at a given index from a bytes-encoded tuple of consecutive 32-byte static values.
function getTupleWord(bytes memory tuple, uint256 index) public pure returns (bytes32);Parameters
| Name | Type | Description |
|---|---|---|
| tuple | bytes | |
| index | uint256 |
Returns
| Name | Type | Description |
|---|---|---|
| <none> | bytes32 |
getArrayWord
Returns the 32-byte word at a given index from a dynamic array.
function getArrayWord(bytes32[] memory arr, uint256 index) public pure returns (bytes32);Parameters
| Name | Type | Description |
|---|---|---|
| arr | bytes32[] | |
| index | uint256 |
Returns
| Name | Type | Description |
|---|---|---|
| <none> | bytes32 |
Errors
IndexOutOfBounds
error IndexOutOfBounds();