Skip to content

Latest commit

 

History

History
39 lines (22 loc) · 997 Bytes

README.md

File metadata and controls

39 lines (22 loc) · 997 Bytes

Huffman Encoder using python.

Introduction

In 2004, as a lark, I created a Huffman Encoder web page using VBscript/ASP. I found the code on an old CD-R and decided to migrate it to python.

What is Huffman?

It's an encoding mechanism whereby a tree of nodes is formed from a source text, then strings can be encoded using that tree to potentially make the string smaller.

The nodes are typically binary, 1 and 0.

As an example:

Just a simple test.

coverts into

000011111110000001010111111000111001000010011111101010100100101111011010001010110000001

While that seems to be longer, the binary can be converted into characters, so the actual length is the binary stream divided by 8.

Huffman Reference

Features

  • lossless compression

Uses

  • obfuscate a string