Skip to content
LogoLogo

Bytes32Helper

Git Source

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

NameTypeDescription
abytes32
bbytes32

Returns

NameTypeDescription
<none>bool

ternary

Ternary evaluation for bytes32 type.

function ternary(bool condition, bytes32 a, bytes32 b) external pure returns (bytes32);

Parameters

NameTypeDescription
conditionbool
abytes32
bbytes32

Returns

NameTypeDescription
<none>bytes32

arrayOf

Returns an array from the two given values.

function arrayOf(bytes32 a, bytes32 b) external pure returns (bytes32[] memory);

Parameters

NameTypeDescription
abytes32
bbytes32

Returns

NameTypeDescription
<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

NameTypeDescription
tuplebytes
indexuint256

Returns

NameTypeDescription
<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

NameTypeDescription
arrbytes32[]
indexuint256

Returns

NameTypeDescription
<none>bytes32

Errors

IndexOutOfBounds

error IndexOutOfBounds();