lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


2014-03-26 11:02 GMT+02:00 Lorenzo Donati <lorenzodonatibz@tiscali.it>:
> On 23/03/2014 07:09, Jeremy Ong wrote:
>> Many binary protocols are more easily expressible with raw binary than
>> hex. This is because, to save space, single bits are often used to
>> represent something (possibly a continuation bit), thus allowing a
>> tighter packing.
>>
> Yep, that was, more or less, the use case I had in mind.

Am I missing something?

> function _b(s) return tonumber(s,2) end
> knuthsfriend = _b"001010001010"