@edgetoken/core
    Preparing search index...

    Function pae

    • Computes PASETO Pre-Authentication Encoding (PAE).

      PAE standardizes a list of arbitrary byte arrays into an unambiguous, length-prefixed sequence to prevent canonicalization attacks.

      Format: LE64(count) || LE64(len(p0)) || p0 || LE64(len(p1)) || p1 ...

      Parameters

      • pieces: Uint8Array<ArrayBufferLike>[]

        An array of Uint8Array buffers to encode in order.

      Returns Uint8Array

      A single concatenated Uint8Array buffer containing the full PAE payload.

      const encoded = pae([
      new TextEncoder().encode("v3.local."),
      nonce,
      ciphertext
      ]);