CB> Everything else seems to be working, its just these CRC values that're
anno
CB> me now!
Must programs just use a table look-up for cycle redudancy checking.
If you really want to know how crc works, here goes:
You treat your stream of data as one huge binary number. You
"divide" that large number by a 32-bit number (Most use a number
that has been proven to catch more errors). The CRC is the remainder
after division.
EG (in hex) 3129487a987479812347987234810fffffaa / aaaaaaaa =
CRC value
(message / seed) = CRC value
This is not true division because its modulo 2 based, but you can
make a table of every word and its remainder.
(Let me dig up an old notebook for a x-bit example)
_______________
110101 10001101.....
110101|||| |
------ ||| |
111011||| |
110101||| |
------||| |
011101|| |
000000|| |
------|| |
111010| |
110101| |
------| |
011111 |
000000 |
------ |
111110 |
110101 |
------- |
010110 |
000000 |
------ |
101100 |
110101 |
------ |
110010|
110101|
------|
001110 This the checksum
if the current remainder starts with 1, use the 110101 to divide
if the current remainder starts with 0, use all zeros to divide
Notice that "divide" in this case is really current remainder XOR
110101 (or zero).
Notice that you multiple you data stream by N bits (the same size
as what you divide by - and you just use zeros).
--- GEcho 1.00
---------------
* Origin: Digital OnLine Magazine! - (409)838-8237 (1:3811/350)
|