forked from baumann-at/base45-php
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.php
More file actions
39 lines (25 loc) · 699 Bytes
/
test.php
File metadata and controls
39 lines (25 loc) · 699 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php
/*
Testing the base45 library ...
Test cases from https://datatracker.ietf.org/doc/draft-faltstrom-base45/
30.3.2021
Chris Baumann - c.baumann@baumann.at
*/
require('base45.php');
$res = base45_encode('AB');
echo("$res\r\n"); // BB8
$res = base45_encode('Hello!!');
echo("$res\r\n"); // %69 VD92EX0
$res = base45_encode('base-45');
echo("$res\r\n"); // UJCLQE7W581
$res = base45_decode('BB8');
echo("$res\r\n"); // AB
$res = base45_decode('%69 VD92EX0');
echo("$res\r\n"); // Hello!!
$res = base45_decode('UJCLQE7W581');
echo("$res\r\n"); // base-45
$res = base45_decode('QED8WEX0');
echo("$res\r\n"); // ietf!
$res = base45_decode('x'); // raises exception
echo("$res\r\n");
?>