print my $out = join '', map {substr unpack('B8'), 1} split //, '4B';