Skip to content

a web / url safe PHP class for Huffman Greedy Algo-3 compression - works with my Javascript class

License

Notifications You must be signed in to change notification settings

StuAngel/php-s2huffman

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

php-s2huffman

web / url safe Huffman Greedy Algo-3

I was sick to death of using Base64 encoding as it can potentially make a string up to 3 times its original size so I have implemented the Huffman Greedy Algo-3, now I can actually send data between client and server with smaller that original rather than larger packets.

$huffman = new s2huffman();

$c = $huffman->compress("aaaaabbbbbbbbbccccccccccccdddddddddddddeeeeeeeeeeeeeeeefffffffffffffffffffffffffffffffffffffffffffff");

/* $c equals s2[66ML63M64]ML61M62]M65K].00e0CCCCCDDDDDDDDD924924924B6DB6DB6DBFFFFFFFFFFFE00000000000 */

$result = $huffman->decompress(c);

/* $result equals aaaaabbbbbbbbbccccccccccccdddddddddddddeeeeeeeeeeeeeeeefffffffffffffffffffffffffffffffffffffffffffff */

About

a web / url safe PHP class for Huffman Greedy Algo-3 compression - works with my Javascript class

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages