Skip to content
This repository has been archived by the owner on Dec 13, 2020. It is now read-only.
/ pdu.ts Public archive

Protocol Data Unit 🦂 Implementation for TypeScript ❄️

License

Notifications You must be signed in to change notification settings

0xF6/pdu.ts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PDU.ts

Protocol Data Unit 🦂 Implementation for TypeScript ❄️

Install

  1. yarn add pdu.ts or
  2. npm i pdu.ts

Usage

import { PDUParser } from 'pdu.ts';

API

type pduMessage = {
    smsc: string;
    smsc_type: number;
    receiver: string;
    receiver_type: number;
    encoding: "16bit" | "8bit" | "7bit";
    text: string;
    request_status: boolean;
};

Generate(message: pduMessage): Array<string>;
Parse(pdu: string)
detectEncoding(dataCodingScheme: string | number): "7bit" | "8bit" | "16bit";
decode16Bit(data: string, length: number): string;
decode7Bit(code: string, length: number, unPadding?: any): string;
encode7Bit(inTextNumberArray: Array<number>, paddingBits?: number): string;
encode16Bit(inTextNumberArray: Array<number>): string;
messageToNumberArray(message: any): any[];
parseStatusReport(pdu: string, smsc_parsed: any): any;
deSwapNibbles(nibbles: any): string;
swapNibbles(nibbles: any): string;
parseSMSCPart(pdu: string): any;
parseTS(ts: any): Date;
TP_MTI_To_String(tp_mti: "00" | "01" | "10"): "unknown" | "SMS-DELIVER" | "SMS-SUBMIT" | "SMS-STATUS-REPORT";
randomHexa(size: number): string;
octetLength(str: string): string;
ussdEncode(ussd: string): string;

About

Protocol Data Unit 🦂 Implementation for TypeScript ❄️

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published