@edgetoken/core
    Preparing search index...

    Function toBytes

    • Normalizes an input string or byte array into a Uint8Array.

      If the input is already a Uint8Array, it is returned directly; otherwise, the string is encoded using UTF-8.

      Parameters

      • input: string | Uint8Array<ArrayBufferLike>

        The UTF-8 string or Uint8Array to convert.

      Returns Uint8Array

      A Uint8Array representation of the input.

      const bytes = toBytes("hello world");