P
pieroxy
pieroxy.net · Personal blog · on HN since 2013
Pieroxy is a developer who writes about JavaScript tools, including the lz-string compression library, and compares Node.js and Nashorn.
What HN saysHN commenters recommend lz-string as an excellent library that worked flawlessly for compressing strings in JavaScript, such as in URLs, and cite it in encoding discussions.
15HN people shared it
10linked it in comments
5stories submitted
33story points
3 years agolast shared
2013people per year2026
Most-shared posts
- 1Lz-string: Fast JavaScript compression11 people · 23 points · first shared 2013 · 2 comments on HN
- 2ColorFinder: Find the most prominent color in an image1 people · 9 points · first shared 2016 · 2 comments on HN
- 3Lz-string: JavaScript compression, fast1 people · 1 points · first shared 2016 · discussion on HN
- 4Reeder and its companion apps readability vs pocket vs instapaper1 people · first shared 2014
- 5Node js vs java nashorn1 people · first shared 2017
What HN people wrote when they linked it
ignoramous · 2020-09-20
I needed something similar for a javascript project and stumbled upon this excellent library by pieroxy that worked flawlessly: https://pieroxy.net/blog/pages/lz-string/index.html
base65536 looks pretty similar to that except that base65536 is not as much focused on compression than it is on "copy-paste-ability".
Shoco is another excellent library that comes to mind for shorter strings: https://ed-von-schleck.github.io/shoco/
willcipriano · 2020-06-23
It's probably similar to this: https://pieroxy.net/blog/pages/lz-string/index.html
Check the 'How does it look?' section.
vanderZwan · 2018-10-01
Look under "More Features" of the main website[0][1].
> kabas.online can be opened passing a programm within an URL parameter
If the author of the language reads this: you could try shortening the URL with LZString[2].
[0] https://kabas.online/main.html
[1] https://kabas.online/run.html?title=Run&code=sz%20%3D%20100%0Acolo…
[2] http://pieroxy.net/blog/pages/lz-string/index.html
ramses0 · 2018-07-03
Why not `zip blah.zip blah.html` and do it all as a single html doc?
http://pieroxy.net/blog/pages/lz-string/index.html
https://github.com/pieroxy/lz-string/blob/master/libs/lz-string.min.js
~5kb gets you an lz-decoder, and you should be able to pull a bunch of trickery with blobs and compressed strings to get somewhere?
cderwin · 2017-07-12
I can't speak to whether it is used more often, but I would bet the java-based Nashorn vm is significantly slower than the c++-based nodejs. In fact, a cursory google search shows this is the case, and it's not even close.
See:
http://blog.jonasbandi.net/2014/03/performance-nashorn-vs-node.html
http://pieroxy.net/blog/2015/06/29/node_js_vs_java_nashorn.html
(I can't speak to the quality of either of these tests, but the results seem decisive)
joantune · 2017-02-28
Yup on all accounts, although:
> Not if you want to store more than few MB (5 or 10 max depending of browsers if I recall)
There's a case for something like
http://pieroxy.net/blog/pages/lz-string/index.html
which can save up a lot of space
mike_r_parsons · 2016-11-02
teklulz · 2014-12-08
napoleond · 2014-04-20
If you're purely interested in client-side compression in the browser (i.e. compatibility with server libraries/filesystem tools is not important) it's possible to get better compression in less time using http://pieroxy.net/blog/pages/lz-string/index.html
Fishkins · 2013-11-12
I've been using LZString for data I put in LocalStorage. Obviously you can still hit the limit, but it takes quite a bit longer.
http://pieroxy.net/blog/pages/lz-string/index.html