Skip to content

Instantly share code, notes, and snippets.

@volodymyr-mykhailyk
Created June 13, 2012 10:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save volodymyr-mykhailyk/2923232 to your computer and use it in GitHub Desktop.
Save volodymyr-mykhailyk/2923232 to your computer and use it in GitHub Desktop.
JS LZW Compression procedures
var originalString = "some data that should be compressed";
//convert string to bytes array
var originalBytes = stringToByteArray(originalString).join("");
//compress data
var compressedData = compress(originalBytes);
//serialize the data
var serializedData = compressedData.join(",");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment