Skip to content

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

License

Notifications You must be signed in to change notification settings

StuAngel/javascript-s2huffman

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 

Repository files navigation

javascript-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 web safe data between client and server with smaller than original rather than larger packets.

var huff = new s2huffman();

var c = huff.compress("aaaaabbbbbbbbbccccccccccccdddddddddddddeeeeeeeeeeeeeeeefffffffffffffffffffffffffffffffffffffffffffff");

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

var result = huff.decompress(c);

/* result equals aaaaabbbbbbbbbccccccccccccdddddddddddddeeeeeeeeeeeeeeeefffffffffffffffffffffffffffffffffffffffffffff */

About

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

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published