News for hackers. Stuff that matters.
Re:Show HN: How to store a set of four 5-bit values in one 1... by RandomCSGeek on Sunday January 28, 2018 @12:53AM (#16250042)
I haven't learned about compression of data, but from what I know, one has to make some assumptions to store n bit data into m bit space, where m < n. Here, the assumption seems to be that numbers are necessarily 5 bit, and that there are only 4 numbers.

What I fail to understand is how this helps to compress the data in this case. The code isn't really that nice, and the comments seem to assume prior knowledge is this field, which I don't have.

So can someone give a ELI-Noob?

Re:Show HN: How to store a set of four 5-bit values in one 1... by SilasX on Sunday January 28, 2018 @01:03AM (#16250063)
It’s not perfect compression; it’s lossy. Per the top comment, this method treats it as a set i.e. ignore the order. So you’re throwing out some information.

https://news.ycombinator.com/item?id=16249092