https://github.com/thedumbtechguy/ussd-pdu-converters
PDU (Portable Data Unit) Converters implemented currently in Java and PHP.
https://github.com/thedumbtechguy/ussd-pdu-converters
converters-implemented java pdu php ussd
Last synced: 11 months ago
JSON representation
PDU (Portable Data Unit) Converters implemented currently in Java and PHP.
- Host: GitHub
- URL: https://github.com/thedumbtechguy/ussd-pdu-converters
- Owner: thedumbtechguy
- Created: 2015-09-29T11:01:03.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2015-09-29T11:54:50.000Z (over 10 years ago)
- Last Synced: 2023-04-01T09:57:23.683Z (about 3 years ago)
- Topics: converters-implemented, java, pdu, php, ussd
- Language: Java
- Size: 246 KB
- Stars: 7
- Watchers: 2
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# PduConverters
PDU (Portable Data Unit) Converters implemented currently in Java and PHP.
I needed to convert between PDU and simple text for a USSD project. All I could find online were SMS PDU converters and they didn't work for me.
I found https://github.com/gnomeby/ussd and extracted the conversion code. The PHP version is a exactly what I took from the code.
The Java version is a direct port.
## Usage
For PHP
```php
require 'Converter.php';
use Pdu\Converter;
var_dump(Converter::toPDU('*124#')); //-> string 'AA988C3602' (length=10)
var_dump(Converter::toText('54747A0E6A97E7F3F0B90CBA87E7A0F1DB6D2FCBE9657208')); //-> string 'This message was converted!' (length=27)
```
For Java
```java
//copy the code into your project or however you do these things
Converter.toPDU("*124#");
Converter.toText("54747A0E6A97E7F3F0B90CBA87E7A0F1DB6D2FCBE9657208");
```
## Copyright
Please use as you please.
If you can, contribute improvements you make to the code.
If you port it into another language, it would be great if you contributed that back as well.
We have a suprising vacuum in this area online.