PHP Classes

File: example

Recommend this page to a friend!
  Classes of Sam S   ASCII85   example   Download  
File: example
Role: Example script
Content type: text/plain
Description: An example of ASCII85 encoding
Class: ASCII85
Encode and decode data using the ASCII85 algorithm
Author: By
Last change:
Date: 17 years ago
Size: 940 bytes
 

Contents

Class file image Download
<?php
//header("Content-Type: image/x-icon");
header("Content-Type: text/plain");
include(
"ascii85.php");
//$w = file_get_contents("favicon.ico");
$a = new ASCII85;
$r = "Man is distinguished, not only by his reason, but by this singular passion from other animals, which is a lust of the mind, that by a perseverance of delight in the continued and indefatigable generation of knowledge, exceeds the short vehemence of any carnal pleasure.";


$en = $a->encode($r);
$de = $a->decode($en);

echo
$en."\n\n".$de;

/* The encoded string ($en) should match this.
$t = "<~9jqo^BlbD-BleB1DJ+*+F(f,q/0JhKF<GL>Cj@.4Gp$d7F!,L7@<6@)/0JDEF<G%<+EV:2F!,
O<DJ+*.@<*K0@<6L(Df-\0Ec5e;DffZ(EZee.Bl.9pF"AGXBPCsi+DGm>@3BB/F*&OCAfu2/AKY
i(DIb:@FD,*)+C]U=@3BN#EcYf8ATD3s@q?d$AftVqCh[NqF<G:8+EV:.+Cf>-FD5W8ARlolDIa
l(DId<j@<?3r@:F%a+D58'ATD4$Bl@l3De:,-DJs`8ARoFb/0JMK@qB4^F!,R<AKZ&-DfTqBG%G
>uD.RTpAKYo'+CT/5+Cei#DII?(E,9)oF*2M7/c~>";
*/
?>