@exodus/bytes
    Preparing search index...

    Function utf16toStringLoose

    • Decode UTF-16 bytes to a string (loose mode)

      Replaces invalid UTF-16 byte sequences with replacement codepoints U+FFFD per WHATWG Encoding specification.

      Such replacement is a non-injective function, is irreversible and causes collisions.
      Prefer using strict throwing methods for cryptography applications.

      Throws on non-even byte length.

      Parameters

      • arr: Uint16Array

        The bytes to decode

      • Optionalformat: "uint16"

        Input format (default: 'uint16')

      Returns string

      The decoded string

    • Decode UTF-16 bytes to a string (loose mode)

      Replaces invalid UTF-16 byte sequences with replacement codepoints U+FFFD per WHATWG Encoding specification.

      Such replacement is a non-injective function, is irreversible and causes collisions.
      Prefer using strict throwing methods for cryptography applications.

      Throws on non-even byte length.

      Parameters

      • arr: Uint8Array

        The bytes to decode

      • format: "uint8-le"

        Input format (default: 'uint16')

      Returns string

      The decoded string

    • Decode UTF-16 bytes to a string (loose mode)

      Replaces invalid UTF-16 byte sequences with replacement codepoints U+FFFD per WHATWG Encoding specification.

      Such replacement is a non-injective function, is irreversible and causes collisions.
      Prefer using strict throwing methods for cryptography applications.

      Throws on non-even byte length.

      Parameters

      • arr: Uint8Array

        The bytes to decode

      • format: "uint8-be"

        Input format (default: 'uint16')

      Returns string

      The decoded string

    • Decode UTF-16 bytes to a string (loose mode)

      Replaces invalid UTF-16 byte sequences with replacement codepoints U+FFFD per WHATWG Encoding specification.

      Such replacement is a non-injective function, is irreversible and causes collisions.
      Prefer using strict throwing methods for cryptography applications.

      Throws on non-even byte length.

      Parameters

      • arr: Uint8Array<ArrayBufferLike> | Uint16Array<ArrayBufferLike>

        The bytes to decode

      • Optionalformat: Utf16Format

        Input format (default: 'uint16')

      Returns string

      The decoded string