in reply to Re: Run length encode a bit vector
in thread Run length encode a bit vector
The parent could use B* instead of B32.
Methods that rely on unpack('B*', $bytes) can even handle arbitrary long packed string if they are packed in "network" (big endian) order.
my $bytes = pack 'N*', 0x01020304, 0x05060708; my $bits = unpack 'B*', $bytes; ...
(By the way, the == 1 is superfluous in the parent's code.)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Run length encode a bit vector
by TJPride (Pilgrim) on Jan 05, 2012 at 20:42 UTC | |
by ikegami (Patriarch) on Jan 05, 2012 at 20:59 UTC |