Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The article says that 42.zip compresses 4.5 petabytes down to 42 bytes. It should say 42 kilobytes.

I don't see a way to comment on the article itself, but hopefully the author reads this.



Thank you. I was going crazy trying to think of what the contents of that 42 bytes would have been.


Without any headers, metadata or padding and using RLE one byte for 0 and 8 bytes for the number of zeroes: 10^15 will easily fit 9 bytes and can be used to generate a file filled with one petabyte of zeroes.


Well, yes, but that's not ZIP encoding.


thanks I fixed it


Another small point, you don't need that starts with function, just use strpos === 0.


It's actually good practice to wrap a bit of code like that in a function with a name, as long as it isn't in some kind of extremely frequently executed inner loop.

'starts_with' is descriptive and language agnostic where '=== 0' is neither.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: