News for hackers. Stuff that matters.
Re:PHP filter_var shenanigans by Dylan16807 on Monday March 28, 2022 @02:56AM (#30827858)
I don't think I would say "exceptionally well" as a rule. Compression algorithms often leave a lot on the table for very long repetitions. For example, gzip can only encode repetitions up to 258 bytes, and the absolute best case for encoding that costs 2 output bits. And then a 4GB file of the same character over and over compresses to a 4MB file primarily made of... the same character over and over.
Re:PHP filter_var shenanigans by viraptor on Monday March 28, 2022 @06:13AM (#30828988)
I think that classifies as exceptionally well. You get 1000x compression and when trying to send a compressed payload, the issue of "the server may time out the connection" pretty much goes away. 4MB is trivial to send from almost anywhere - to hit the 30s timeout, you'd need to go slower than 137KB/s.
Re:PHP filter_var shenanigans by Dylan16807 on Monday March 28, 2022 @01:25PM (#30833028)
It could trivially enable millions or billions to 1 compression, though. It just needs the option of a longer length field. With even a single megabyte of repeated data, it has to split it into four thousand chunks. That's not exceptional in my book.

I'll call it exceptional when it can encode any real-drive-size repeated-character file into the size of a tweet.