Function hexToBytes

Convert hex string to byte array. Uses built-in function, when available.

hexToBytes('cafe0123') // Uint8Array.from([0xca, 0xfe, 0x01, 0x23])
  • Parameters

    • hex: string

    Returns Uint8Array