Create a hexadecimal string from a bytes-like value.
Uint8Array
const value = createHex(new Uint8Array([1, 2, 3]));console.log(value); // '0x010203'const otherValue = createHex('0x010203');console.log(otherValue); // '0x010203'
The created hex string.
If the value is not a bytes-like value.
The value to create the hex string from.
Create a hexadecimal string from a bytes-like value.
Uint8Array
, it is converted to a hex string.Example
Returns
The created hex string.
Throws
If the value is not a bytes-like value.