ngHuffman – AngularJS wrapper for the Huffman encoding technique.

Hi Friends,

Thanks to everyone who have visited this site for the past 2 years. I will try to write more stuff. (Actually, I don’t get much time).

Anyway, I was experimenting with a new algorithm to compress images; and while doing that I wrote some code to create a angularJS wrapper for the Huffman encoding technique.

The Huffman encoding technique is a widely used method to compress strings or text.

So how do we use it in our app ?

You can install the module using npm:

npm install nghuffman

Then reference the js file in your index.html as shown below:

Now add the ngHuffman dependency in your app.js file as shown below:

Now we could use the service huff to implement the compression technique.

First we create the tree using treeFromtext function and then we encode our text as shown below.

Pretty easy right ?

I have hosted a sample app on github at the below link

Please note that this is just a AngularJS wrapper for the javascript implementation of the Huffman encoding technique which was originally written by wilkerlucio. All credits go to him.

Thanks for reading guys. Peace.. 😀