PHP code example of dynoser / base85

1. Go to this page and download the library: Download dynoser/base85 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/ */

    

dynoser / base85 example snippets



use dynoser\base85\vc85; // Include to use the short name vc85

By default, mode 2 (vwx85) is used.

$en = vc85::encode("Some data"); // Encode some data in vc85

echo $en; // Display the result

$de = vc85::decode($en); // Decode back into a byte string

vc85::$addPf = false; // false - do not add, true - add. By default, it adds.

vc85::$splitWidth = 0; // 0 - do not break into lines. Default is 75, breaking into lines of 75 characters.

vc85::init(1); // Encoder will output data in classic ASCII85 format.
vc85::init(2); // (Default) - output in vwx85 format (replaces `"` with `v`, `'` with `w`, `\` with `x`).
vc85::init(3); // vc85 (special characters replaced with Cyrillic characters in utf-8 encoding).
vc85::init(4); // Same as 3, but Cyrillic characters represented in cp1251 encoding.