happy-codec
    Preparing search index...

    Function decodeByteString

    • Decodes a byte string to Uint8Array, with each character's charCode as a byte.

      Parameters

      • byteString: string

        The byte string to decode.

      Returns Uint8Array<ArrayBuffer>

      Uint8Array.

      If the input is not a string.

      If string contains characters with charCode above 0xff.

      1.0.0

      const bytes = decodeByteString('Hello');
      console.log(bytes); // Uint8Array [72, 101, 108, 108, 111]