5 ms·
This is basically encoding(base64?) the <textarea> and putting it in the URL. Its a neat idea, but I think theres a limit to how long URLs can be.
by jayski 2y ago
This is basically encoding(base64?) the <textarea> and putting it in the URL.
Its a neat idea, but I think theres a limit to how long URLs can be.
- erhaetherth 2y agoShould have used base65536.
- revolter 2y ago[dead]
- sanchez_0_lam 2y agoOuch, that's bad :D Won't store too long texts.
- baliex 2y agoIt is at least compressed to make the most of the limit
- deleted 2y ago[deleted]
- erhaetherth 2y agobase64 is the opposite of compressed. Does it actually apply compression before base64-encoding? Doesn't really look like it by watching the URL.
- skipnup 2y agoIt’s actually compressed. It uses https://github.com/nodeca/pako https://github.com/nodeca/pako and then applies base64. Try entering hundreds of "a" and you’ll see that the base64 doesn’t really get much longer.
- bozey07 2y agoWhat gave you that impression? I tried spamming "a" and the URL indeed did not get longer. Reassuringly: function serialize(value) { if (value === '') { return ''; } const data = new TextEncoder().encode(value); const compressed = pako.deflate(data, { level: 9 }); return Base64.fromUint8Array(compressed, true); }
- valbaca 2y agoit does get longer. rather than typing in aaaa copy and paste it and copy and paste that to grow exponentially
- JTyQZSnP3cQGa8B 2y agoIIRC in theory it’s 2048 characters, but in practice it’s 2000 (at least in Chrome a few years ago when I toyed with Google Maps for food).
- hobs 2y agoIt's actually much longer, I was implementing a javascript bookmarklet and the old published limitations are not respected by much anymore, so you can shove a LOT of data in there.
- revolter 2y ago[dead]