Can you provide a demo for string-to-string decompression?
hsluoyz opened this issue · comments
I saw the nice demo here: https://pieroxy.net/blog/pages/lz-string/demo.html but it doesn't support decompress a string:
How did you get that String ? It looks like a Base64 string, the demo page is meant to compress with compressToUTF16 and represent the data in hexadecimal form. Try to input a short string in the top box and hit compress. You will be able to decompress that.
@pieroxy that string is encoded from this function:
export function lzStringEncode(str) {
return LZString.compressToEncodedURIComponent(str);
}
Is it possible to decode it in the online demo?
Not as of now from the UI. What you can do is press F12
when on the demo page and call LZString directly. For example:
LZString144.compressToEncodedURIComponent("blah blah");
"EYGwhgFgBKlA"
LZString144.decompressFromEncodedURIComponent("EYGwhgFgBKlA");
"blah blah"
I can sure do that, yes.