Skip to main content

bytesToHex

Callable

  • bytesToHex(bytes: Bytes): string

  • Convert a byte array to a hex string

    @example
    console.log(web3.utils.bytesToHex(new Uint8Array([72, 12])));
    > "0x480c"

    Parameters

    • bytes: Bytes

      Byte array to be converted

    Returns string

    • The hex string representation of the input byte array