Skip to main content
Helpful?

HexStrings

Git Source - Generated with forge doc

Provides function for converting numbers to hexadecimal strings

Reference: https://github.com/Uniswap/v3-periphery/blob/main/contracts/libraries/HexStrings.sol

State Variables

ALPHABET

bytes16 internal constant ALPHABET = "0123456789abcdef";

Functions

toHexStringNoPrefix

Convert a number to a hex string without the '0x' prefix with a fixed length

function toHexStringNoPrefix(uint256 value, uint256 length) internal pure returns (string memory);

Parameters

NameTypeDescription
valueuint256The number to convert
lengthuint256The length of the output string, starting from the last character of the string

Returns

NameTypeDescription
<none>stringThe hex string
Helpful?