jesobreira / base10
A base10 encoder as an alternative to base64.
dev-main
2023-09-12 02:17 UTC
Requires
- php: >=7.4
This package is auto-updated.
Last update: 2025-01-12 05:20:38 UTC
README
This algorithm works like Base64 but uses numbers only as the output encoded string.
Not sure why you would want it, tho.
Please note that due to the limited character set, the output strings are going too long.
Compatible Javascript/Node version here
Examples
<?php
include './src/Base10.php';
$original = 'Hello, world!';
echo "Original string: " . $original . PHP_EOL;
$encoded = jesobreira\Base10::encode($original);
echo "Encoded string: " . $encoded . PHP_EOL;
$decoded = jesobreira\Base10::decode($encoded);
echo "Decoded string " . $decoded . PHP_EOL;
Or with composer (composer require jesobreira/base10
):
<?php
require __DIR__ . '/vendor/autoload.php'; // Require Composer's autoloader
use jesobreira\Base10;
$original = 'Hello, world!';
echo "Original string: " . $original . PHP_EOL;
$encoded = Base10::encode($original);
echo "Encoded string: " . $encoded . PHP_EOL;
$decoded = Base10::decode($encoded);
echo "Decoded string " . $decoded . PHP_EOL;