Leser: 17
$Kopie_daten = $Original_daten;
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
use Digest::MD5 qw(md5_hex); $buffer = "\x01\x02Test"; $checksum = md5_hex($buffer); $transfer_data = $checksum . $buffer; ... # Daten senden ... ... ... # Datenempfang $receive_data = .....; $checksum = substr($receive_data,0,32); $buffer = substr($receive_data,32); if (md5_hex($buffer) ne $checksum ) { # falsche Prüfsumme # Übertragung nicht ok .... }