LibKeccak256
Functions
hashBytes
Hash a variable-length byte array.
function hashBytes(bytes memory b) internal pure returns (bytes32 result);
Parameters
| Name | Type | Description |
|---|---|---|
b | bytes | The byte array |
hashBlock
Hash a data block at a given index and of a given size.
If the data block is too large, an out-of-memory error might be raised.
If the data block index is too big, an arithmetic error might be raised.
function hashBlock(bytes memory data, uint256 dataBlockIndex, uint256 dataBlockSize)
internal
pure
returns (bytes32 result);
Parameters
| Name | Type | Description |
|---|---|---|
data | bytes | The data |
dataBlockIndex | uint256 | The data block index |
dataBlockSize | uint256 | The data block size |
hashPair
Hash a pair of 32-byte values.
Equivalent to keccak256(abi.encode(a, b)).
Uses assembly to avoid memory allocation or expansion.
function hashPair(bytes32 a, bytes32 b) internal pure returns (bytes32 result);