deemru / abcode
ABC (alphabet) encode/decode
Installs: 9 406
Dependents: 3
Suggesters: 0
Security: 0
Stars: 0
Watchers: 3
Forks: 0
Open Issues: 0
Requires
- php: >=5.4
- ext-gmp: *
README
ABCode is a universal (single byte per character) alphabet converter for PHP.
- Built in base58
- Convert strings to your alphabet
- Convert between alphabets
Usage
// Built in base58 $data = ABCode::base58()->encode( 'Hello, world!' ); if( $data !== '72k1xXWG59wUsYv7h2' ) exit( 1 ); // Convert strings to your alphabet $abcode = new ABCode( 'my_ABC' ); $data = $abcode->encode( $data ); if( $data !== 'BAAy_Cmm_BA_AC_BCA_A_ymymCCmyyBBABBACCyBm___mA_BAm_yA__' ) exit( 1 ); // Convert between alphabets $abcode = new ABCode( 'my_ABC', 'another_ABC-123' ); $data = $abcode->decode( $data ); if( $data !== 'otah2_en3_o22ABhhrroA1eCAC3ronBn3t2-o' ) exit( 1 );
Requirements
Installation
Require through Composer:
{ "require": { "deemru/abcode": "1.0.*" } }