Compression of random binary data

Neil Cerutti neilc at norwich.edu
Mon Oct 23 13:41:24 EDT 2017


On 2017-10-23, alister via Python-list <python-list at python.org> wrote:
>>>>>> 1234999988884321
>>>>>>
>>>>>> It only takes seven 8 bit bytes to represent this
>>>>>
>>>>> Would you care to provide the seven 8-bit bytes you propose to use?
>>>>> Paul
>>>>
>>>> I would suspect he is using BCD & storing 2 values in reach
>>>> byte that is not what is meant by you cant compress random
>>>> data. his compression is simply removing redundant space
>>>> from an inefficient coding
>>>
>>> I suspect he is using ASCII and storing one value in each byte.
>> 
>> There's also ZSCII, which stores roughly 3 characters every 2
>> bytes. Since all the digits are in A2, this sequence would
>> take up 7 bytes in ZSCII as well.
>> 
>> http://inform-fiction.org/zmachine/standards/z1point0/sect03.html
>
> not sure how 16 characters can be represented by either ascii
> or zscii in only 8 bytes

Oops! I hastily counted completely wrong. It's 10 bytes in ZSCII
version 2, using a shift-lock.

       ----* 16 bits* ----
12 ->  0 00101 01001 01010
349 -> 0 01011 01100 10001
999 -> 0 10001 10001 10001
888 -> 0 10000 10000 10000
843 -> 0 10000 01100 01011
21  -> 1 01010 01001 00101

-- 
Neil Cerutti




More information about the Python-list mailing list