Created
February 11, 2016 00:53
-
-
Save robmint/3ee21f982b1771aaff2f to your computer and use it in GitHub Desktop.
Huffman compression of URLs in node.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// just a test to see if compressing url-encoded json looks/works any better | |
var strofa = require("strofa"); | |
cl = function(obj) { console.dir(obj, {depth: null, colors: true}); }; | |
var string = '{"subjectonly_keyword":["ACCTG 713"]}'; | |
cl(string); | |
cl(encodeURIComponent(string)); | |
var output = strofa.english.encodeBase64(string); | |
cl(output); | |
cl(strofa.english.decodeBase64(output)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment