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.
In reply to Re: Interleaving bytes in a string quickly
by shmem
in thread Interleaving bytes in a string quickly
by BrowserUk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |