<commit_before>pdu.js
======

PDU parser and generator written in javascript

Howto install
-------------
For node:

    npm install pdu.js

or, in browser

    <script type="text/javascript" src="pdu.js/pdu.js"></script>


Usage
=====

pdu.generate()
------------
    pdu.generate({
      text:'Some text',
      receiver:98xxxxxxxxxx
      encoding:'16bit' //Or 7bit if you're sending an ascii message.
    });

returns an array of generated pdu's.

pdu.parse()
----------
      pdu.parse('06918919015000240C9189194238148900003110211052254117CAB03D3C1FCBD3703AA81D5E97E7A079D93D2FBB00')

Returns an object, containing parsed information:

    { smsc: '9891100500',
    smsc_type: '91',
    sender: '989124834198',
    sender_type: '91',
    encoding: '7bit',
    time: 1357953952000,
    text: 'Javascript makes sense.' }<commit_msg>Readme looks much better now<commit_after># pdu.js

PDU parser and generator for node or your browser.

## How to install

```bash
npm install pdu.js
```

## How to use

First require it:
```js
var pdu = require('pdu');
```


### pdu.generate()
```js
    pdu.generate({
      text:'Some text',
      receiver:98xxxxxxxxxx //MSISDN
      encoding:'16bit' //Or 7bit if you're sending an ascii message.
    });
```

returns an array of generated pdu's.

### pdu.parse()
```js
pdu.parse('06918919015000240C9189194238148900003110211052254117CAB03D3C1FCBD3703AA81D5E97E7A079D93D2FBB00')
```

Returns an object, containing parsed information:
```js
{ smsc: '9891100500',
smsc_type: '91',
sender: '989124834198',
sender_type: '91',
encoding: '7bit',
time: 1357953952000,
text: 'Javascript makes sense.' }
````
{'fraction_non_alphanumeric': 0.15097799511002444, 'fraction_numerical': 0.14425427872860636, 'mean_word_length': 3.717579250720461, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2688490', 'n_tokens_mistral': 757, 'n_tokens_neox': 588, 'n_words': 146}