mlacosta / huffman-url-compressor Goto Github PK
View Code? Open in Web Editor NEWConvert any kind of String into a url-friendly parameter using Huffman Encoding.
Home Page: https://www.npmjs.com/package/huffman-url-compressor
Convert any kind of String into a url-friendly parameter using Huffman Encoding.
Home Page: https://www.npmjs.com/package/huffman-url-compressor
Hi I'm making good use of the library for one of my projects โ thanks for making it available. I did have to work around one problem though, as shown in the following example (RunKit)
train = "[1300 [[57 4.56 0.12 11 10260 240] [8.600000000000001 5.2 0.44 44 16447 142] [8.600000000000001 240.8 0.08 12 930] [8.600000000000001 0.16 4.63 230 1080] [8.600000000000001 482.1 2.82 490 572] [8.600000000000001 135.1 28.67 820 1185]]]"
troublesomeInput = "[1300 [[56 4.56 0.12 11 10260 240] [44 5.2 0.44 44 16447 142] [0 240.8 0.08 12 930] [0 0.16 4.63 230 1080] [0 482.1 2.82 490 572] [0 135.1 28.67 820 1185]]]"
let Encoder = huffmanUrlCompressor.createEncoder(train);
let encodedParam = huffmanUrlCompressor.encodeConfig(troublesomeInput,Encoder)
let decodParam= huffmanUrlCompressor.decodeConfig(encodedParam,Encoder)
decodParam
turns out as:
[1300 [[56 4.56 0.12 11 10260 240] [44 5.2 0.44 44 16447 142] [0 240.8 0.08 12 930] [0 0.16 4.63 230 1080] [0 482.1 2.82 490 572] [0 135.1 28.67 820 1185]]
As you can see, the trailing Bracket has been lost in the process. Any idea as to what may be causing this behaviour?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.