Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Another email...
#21
Ok, Nathan, I'll consider the code as compliant to the true algorithm. Thanks.
*****
Reply
#22
Quote:Can someone actually explain what on earth CRC does? and what is the difference between CRC-16 and CRC-32?
I'm not sure we answered your question. Even the explanations of the algorithms do not explain the PURPOSE of a CRC.

The purpose of the CRC (Cyclic Redundance Check) is file integrity; that is, to be able to detect when any bits in the file are dropped, added or modified.

This is done via a calculation across the bits of every byte in a file, the results of which calculation, the CRC, are appended to the file. When the file is transmitted (or copied) to another location, you run the calculation again and compare the resultant CRC to the original. If they don't coincide, then the data was corrupted during the transmission or copy. I use the term "copy" because you may copy a file from one location in network to an other, which for all practical purposes is a transmission.

The bigger the resultant CRC is, the more precise it is, so a 16 bit CRC which occupies 2 bytes is good, but a 32 bit CRC in 4 bytes is better.

If you want 100% reliability when transmitting or copying, then you would have to compare the entire received file back to the original. On early arc-net and token-ring LAN's which dropped bits all over the place, this is what I did when I was the Network Supervisor at Citibank. The overhead for the compare was 40% of the copy time. Hey, you want 100%, or you want to fool around with CRC algorithms?
*****
Reply
#23
That sounds a lot like parity on com ports...
/post]
Reply
#24
Quote:That sounds a lot like parity on com ports...

It is better than that. Parity only detects an error if the number of wrong bits is odd Tongue If you got 2348923482384 errors, parity checking says "the file is OK" Big Grin
SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Reply
#25
A brilliant computer design engineer who I worked with used to say
"parity is for farmers"
and sometimes he would say
"parity is not worth the powder to blow it to hell".
*****
Reply
#26
Parity is primitive as compared to CRC =P.
Reply
#27
Quote:CRC32 would be better. Smile
How about CRC-64? It exists, as far as I know Wink
Reply
#28
It may be better than CRC-32 =P. I havent checked it out yet.
Reply
#29
Moneo:
If you are delaing with CRC's you should be aware of this:
[url]
http://c.snippets.org/snip_lister.php?fname=crc.txt
[/url]
There are a lot of variants of CRC!...
Antoni
Reply
#30
Here are the most popular ones:
  • - Checksum (8 bit)
    - Checksum (16 bit)
    - Checksum (32-bit)
    - Checksum (64-bit)
    - CRC-16
    - CRC-16/CCITT
    - CRC-32
    - MD2
    - MD4
    - MD5
    - SHA1

Wink
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)