Lempel Ziv Welch algorithm implementation