in reply to Interleaving bytes in a string quickly
For a string with only one byte value, flipping bits
$out = $buf x 2; vec($out,($_<<4)+8,1) = 0 for 0..length($buf)-1;
seems to be fastest.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Interleaving bytes in a string quickly
by BrowserUk (Patriarch) on Feb 26, 2010 at 13:21 UTC | |
by shmem (Chancellor) on Feb 26, 2010 at 14:22 UTC | |
by BrowserUk (Patriarch) on Feb 26, 2010 at 15:03 UTC |