in reply to Optimize bit stream conversion
Probably little difference performance-wise on such a small dataset; but it could make a notable difference if the dataset is large:
#! perl -slw use strict; my @bits = ( 1, 0, 0, 0, 0, 0, 1, 0, # A / 0x41 / 0b01000001 0, 1, 0, 0, 0, 0, 1, 0, # B / 0x42 / 0b01000010 1, 1, 0, 0, 1, 0, 1 # incomplete byte ); my $data = ''; vec( $data, $_, 1 ) = shift@bits for 0 .. 8*int( @bits/8 ) -1; ## corr +ected for complete bytes print $data; print @bits; __END__ C:\test>1136846.pl AB 1100101
Anyone got any experience of this phone's predecessor?
|
|---|