node-pdu
    Preparing search index...

    Class Helper

    A utility class providing static methods for encoding and decoding SMS messages.

    This class contains methods for converting text into various encoding formats used in SMS, such as GSM 7-bit, 8-bit, and UCS-2 (16-bit). It also includes utility methods for handling characters and converting values to hexadecimal strings.

    Index

    Constructors

    Properties

    ALPHABET_7BIT: "@£$¥èéùìòÇ\nØø\rÅåΔ_ΦΓΛΩΠΨΣΘΞ\u001bÆæßÉ !\"#¤%&'()*+,-./0123456789:;<=>?¡ABCDEFGHIJKLMNOPQRSTUVWXYZÄÖÑÜ`¿abcdefghijklmnopqrstuvwxyzäöñüà" = '@£$¥èéùìòÇ\nØø\rÅåΔ_ΦΓΛΩΠΨΣΘΞ\x1bÆæßÉ !"#¤%&\'()*+,-./0123456789:;<=>?¡ABCDEFGHIJKLMNOPQRSTUVWXYZÄÖÑÜ`¿abcdefghijklmnopqrstuvwxyzäöñüà'
    EXTENDED_TABLE: "````````````````````^```````````````````{}`````\\````````````[~]`|````````````````````````````````````€``````````````````````````" = '````````````````````^```````````````````{}`````\\````````````[~]`|````````````````````````````````````€``````````````````````````'
    limitCompress: 160
    limitNormal: 140
    limitUnicode: 70

    Methods

    • Converts an ASCII string to a Uint8Array.

      Parameters

      • ascii: string

        The ASCII string to convert

      Returns Uint8Array

      A Uint8Array representing the ASCII string

    • Returns the character represented by the specified Unicode code point.

      Parameters

      • order: number

        The Unicode code point

      Returns string

      A string containing the character represented by the code point

    • Decodes a 16-bit encoded string into a human-readable text.

      Parameters

      • text: string

        The 16-bit encoded hexadecimal string

      Returns string

      The decoded text

    • Decodes a 7-bit encoded string into a human-readable text.

      Parameters

      • text: string

        The 7-bit encoded hexadecimal string

      • OptionalinLen: number

        The length of the input data in septets

      • OptionalalignBits: number

        The number of bits for alignment

      Returns string

      The decoded text

    • Decodes an 8-bit encoded string into a human-readable text.

      Parameters

      • text: string

        The 8-bit encoded hexadecimal string

      Returns string

      The decoded text

    • Encodes a text string into 16-bit hexadecimal PDU format.

      Parameters

      • text: string

        The text to encode

      Returns { length: number; result: string }

      An object containing the length of the encoded text in septets and the result as a hexadecimal string

    • Encodes a text string into 7-bit hexadecimal PDU format.

      Parameters

      • text: string

        The text to encode

      • alignBits: number = 0

        The number of bits for alignment, if needed

      Returns { length: number; result: string }

      An object containing the length of the encoded text in septets and the result as a hexadecimal string

    • Encodes a text string into 8-bit hexadecimal PDU format.

      Parameters

      • text: string

        The text to encode

      Returns { length: number; result: string }

      An object containing the length of the encoded text and the result as a hexadecimal string

    • Converts the first two characters of a hexadecimal string to a number.

      Parameters

      • hexStr: string

        The hexadecimal string to convert

      Returns number

      The number represented by the first two characters of the hexadecimal string

    • Converts a hex string to a Uint8Array.

      Parameters

      • hex: string

        The hex string to convert

      Returns Uint8Array

      A Uint8Array representing the hex string

    • Returns the Unicode code point of the first character of the input string.

      Parameters

      • char: string

        A single character string

      Returns number

      The Unicode code point of the character

    • Converts a number to a hexadecimal string with optional zero padding.

      Parameters

      • number: number

        The number to convert

      • fill: number = 2

        The minimum length of the resulting string, padded with zeros if necessary

      Returns string

      The number as a hexadecimal string

    • Capitalizes the first character of the input string.

      Parameters

      • str: string

        The string to capitalize

      Returns string

      The input string with its first character capitalized