EndianHelper
Provides helper functions for converting values to little-endian format
Functions
toLittleEndian
Converts a 256-bit unsigned integer to little-endian format
function toLittleEndian(uint256 value) internal pure returns (bytes32);
Parameters
Name | Type | Description |
---|---|---|
value | uint256 | The unsigned integer to convert |
Returns
Name | Type | Description |
---|---|---|
<none> | bytes32 | The little-endian representation of the input value as bytes32 |
toLittleEndian
Converts a boolean value to its little-endian bytes32 representation
function toLittleEndian(bool value) internal pure returns (bytes32);
Parameters
Name | Type | Description |
---|---|---|
value | bool | The boolean to convert |
Returns
Name | Type | Description |
---|---|---|
<none> | bytes32 | The little-endian representation of the boolean as bytes32 |
reverseBytes64
Reverses a uint64 from little-endian to big-endian (needed in Solidity)
function reverseBytes64(uint64 input) internal pure returns (uint64);