PHP code example of deemru / abcode
1. Go to this page and download the library: Download deemru/abcode library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
deemru / abcode example snippets
// 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 );