Skip to main content

randomHex

Callable

  • randomHex(byteSize: number): string

  • Returns a random hex string by the given bytes size


    Parameters

    • byteSize: number

      The size of the random hex string returned

    Returns string

    • random hex string
    console.log(web3.utils.randomHex(32));
    > 0x139f5b88b72a25eab053d3b57fe1f8a9dbc62a526b1cb1774d0d7db1c3e7ce9e