Skip to main content

asciiToHex

Callable

  • asciiToHex(str: string): string

  • Should be called to get hex representation (prefixed by 0x) of ascii string

    @example
    console.log(web3.utils.asciiToHex('Hello World'));
    > 0x48656c6c6f20576f726c64

    Parameters

    • str: string

      String to be converted to hex

    Returns string

    • Hex string