3 Comments
User's avatar
Salomon Lee's avatar

“To do that we’d typically use the bitwise operations of our chosen programming language. For example if we have one byte that can be represented as 1010 and the other as 1110 we would create the byte 10101110. Thus we’ve compressed these two bytes by 50%.”

sounds more like concatenation than compression… could you clarify a bit more the point you are trying to make?

Expand full comment
Salomon Lee's avatar

Are you implying that if I do 4 bits shift to the first 4 bits and do an OR operation will do compression?

Expand full comment
John Crickett's avatar

The compression works by calculating a unique prefix code that is 1 or more bits for every byte in the source.

The prefixes are them packed into bytes - yes this involves OR and left shift.

Expand full comment