@me2em/crypto
    Preparing search index...

    Function fromHex

    • Decodes a lowercase or uppercase hexadecimal string to a Uint8Array.

      Parameters

      • s: string

        The hex string (even length).

      Returns Uint8Array

      The decoded byte array.

      If the string has odd length or invalid hex characters.

      const bytes = fromHex('0fff');
      // Uint8Array [ 0x0f, 0xff ]