nntp2http.com
Posting
Suche
Optionen
Hilfe & Kontakt

Noch mal neu, CRC aus Header berechnen

Von: Tim Ritberg (tim_rit@gmx.de) [Profil]
Datum: 23.04.2009 12:39
Message-ID: <gspgh5$2e8$00$1@news.t-online.com>
Newsgroup: de.comp.lang.pascal
So, da es nun 2 Thread dazu gab in verschiedenen Gruppen, fass ich das
noch mal zusammen, denn es ist unübersichtlich geworden:

Also ich hab folgenden Header:

HEAD_CRC        CRC of fields HEAD_TYPE to RESERVED2
2 bytes

HEAD_TYPE       Header type: 0x73
1 byte

HEAD_FLAGS      Bit flags:
2 bytes

HEAD_SIZE       header total size including archive comments
2 bytes

RESERVED1       Reserved
2 bytes

RESERVED2       Reserved
4 bytes

Comment block   present if (HEAD_FLAGS & 0x02) != 0

Im Hexeditor seh ich folgendes:

3B D0	die CRC
73 	Typ
08 00	Flags
0D 00   Size (13 bytes)
00 00	Reserve1
00 00 00 00 Reserve2

Von HeadType zu Reserve2:
73 08 00 0D 00 00 00 00 00 00 00

Die CRC muss also sein 3B D0. In der Doku steht:
The CRC is calculated using the standard polynomial 0xEDB88320. In
case the size of the CRC is less than 4 bytes, only the low order bytes
are used.

Weder mein Programm noch ein CRC-Calculator kommen auf 3BD0 oder D03B.
Ich hab ihm das
x16 + x12 + x5 + 1 (CRC16)
und das
x32 + x26 + x23 + x22 + x16 + x12 + x11 + x10 + x8 + x7 + x5 + x4 + x2 +
x + 1 (CRC32)vorgeworfen...



[ Auf dieses Posting antworten ]

Antworten