Thread Hex to signed Integer (1/256)
(9 answers)
Opened by JuMi2006 at 2012-09-17 11:15
Das Encoding geht z. B. so (leider kein Einzeiler):
Code (perl): (dl
)
1 2 3 4 5 6 7 8 sub encode_b2d { my $y = shift; $y *= 256; $y = $y & 0xffff if ($y < 0); my $hb = int $y/256; my $lb = $y % 256; return (sprintf("%0.2X", $hb), sprintf("%0.2X", $lb)); } Aufruf: Gruß
GUIfreund |