PHP Classes

PHP RLE Compression Algorithm: Compress and decompress data using RLE in pure PHP

Recommend this page to a friend!
  Info   View files Example   View files View files (3)   DownloadInstall with Composer Download .zip   Reputation   Support forum (1)   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 233 All time: 8,123 This week: 560Up
Version License PHP version Categories
rle 0.1Free for non-comm...5.0PHP 5, Compression
Description 

Author

This class can compress and decompress data using RLE in pure PHP.

It can take a string of data and compress it with the Run Length Encoding algorithm.

The class can also do the opposite, i.e. decode previously compressed data with the same algorithm.

Innovation Award
PHP Programming Innovation award nominee
December 2014
Number 5


Prize: One copy of the Zend Studio
RLE (Run-Level Encoding) is a simple compression algorithm that compresses data that has many repeated symbols.

This class provides a pure PHP implementation of the REL compression algorith to compress and decompress data.

Manuel Lemos
Picture of Chi H.
  Performance   Level  
Name: Chi H. <contact>
Classes: 28 packages by
Country: France France
Age: 39
All time rank: 34122 in France France
Week rank: 250 Up6 in France France Up
Innovation award
Innovation award
Nominee: 22x

Winner: 3x

Example

<?php
/*
* Copyright (c) 2014 Chi Hoang
* All rights reserved
*/
require_once("main.php");

$obj = new Compress\Rle("aaaabbcc","Encode");
$obj->start();
echo
$obj;
$obj->start("aabbcccccccccccde");
echo
$obj;

$obj = new Compress\Rle("a4b2c2","Decode");
$obj->start();
echo
$obj;

$obj = new Compress\Rle("aabb","Decode");
$obj->start();
echo
$obj;

$obj = new Compress\Rle("aabbccde","Encode");
$obj->start();
echo
$obj;

$obj = new Compress\Rle("aabbccdeaaaaaaaaaaaaaaae","Encode");
$obj->start();
echo
$obj;




?>


  Files folder image Files  
File Role Description
Accessible without login Plain text file compressTest.php Test Unit Test
Accessible without login Plain text file example.php Example example script
Plain text file main.php Class main class

 Version Control Unique User Downloads Download Rankings  
 0%
Total:233
This week:0
All time:8,123
This week:560Up