Thread Hex String umkehren (3 answers)
Opened by Markus at 2015-08-20 14:13

Raubtier
 2015-08-20 17:06
#181851 #181851
User since
2012-05-04
1075 Artikel
BenutzerIn
[default_avatar]
Wie wär's mit diesem Code:
Code (perl): (dl )
1
2
3
4
sub reverseBitsIn8BitChar {
    my $c = shift;
    return 0xFF & ((($c * 0x0802 & 0x22110) | ($c * 0x8020 & 0x88440)) * 0x10101 >> 16);
}


(frei nach http://graphics.stanford.edu/~seander/bithacks.htm...)

View full thread Hex String umkehren