[ed: Shamelessly stolen from http://rcswww.urz.tu-dresden.de/~sr21/crc.html ]
Data sequence
Result
Version updates: 21th of Juli 2003: question#1: how is a crc polynom correctly reflected if the LSB is not 1 (but the high-bit of the polynom is always assumed as 1)?? 21th of Juli 2003: question#2: in c-code, be careful using polynoms having a LSB of 0 (e. g. XMODEM 0x8408)... code doesn't work for such cases!!! Any ideas how to convert direct to nondirect values with polynoms having LSB=0? 21th of Juli 2003: removed bug in reflect() in javascript code, affecting final crc reflecting of crc orders with order%7 != 0 4th of February 2003: outcommented the "LSB=1 test" in JAVASCRIPT and C code 18th of January 2003: included crc masking after converting non-direct to direct initial crc (c-code only, javascript-code is and was correct) 17th of January 2003: included comment concerning standard parameter set values (like CRC-CCITT), see below; included new links to crc pages 13th of January 2003: in crctester.c: most of the int's replaced by unsigned longs to avoid compilation errors (especially on 16 bit machines) This CRC calculator shall support hardware and software designers to check their specific CRC routine. Most of the theory for the JAVASCRIPT and the C code below is taken from the well-known PAINLESS GUIDE TO CRC ERROR DETECTION ALGORITHMS article written by Ross N. Williams.
The calculator has the following features:
Furthermore, here is the complete free C CODE of a simple CRC test programm that offer evaluation of different CRC algorithms (bit-by-bit and table-driven, each with and without augmented zero bytes). For the JAVASCRIPT code see the HTML source ;-) I checked the resulting CRC with those values computed by some simple CRC calculators that I found in the internet (see links) and the values given in the PAINLESS GUIDE TO CRC ERROR DETECTION ALGORITHMS article. Anyway, if there are any errors in computing the CRC, either in the above JAVASCRIPT calculator or in the C program, please contact me under zorci@gmx.de. Next is a list of CRC polynoms that I could find:
CCITT-32: 0x04C11DB7 = x32 + x26 + x23 + x22 + x16 + x12 + x11 + x10 + x8 + x7 + x5 + x4 + x2 + x + 1 CRC-16: 0x8005 = x16 + x15 + x2 + 1 CRC-CCITT: 0x1021 = x16 + x12 + x5 + 1 CRC-XMODEM: 0x8408 = x16 + x15 + x10 + x3 12bit-CRC: 0x80f = x12 + x11 + x3 + x2 + x + 1 10bit-CRC: 0x233 = x10 + x9 + x5 + x4 + x + 1 8bit-CRC: 0x07 = x8 + x2 + x + 1
Finally here are some links to CRC and JAVASCRIPT relavant websites:
www.cs.waikato.ac.nz/~312/crc.txt(Painless guide) www.seanet.com/~ksbrown/kmath458.htm www.geocities.com/CapeCanaveral/Launchpad/3632/crcguide.htm utopia.knoware.nl/users/eprebel/Communication/CRC/index.html www.iti.fh-flensburg.de/lang/algorithmen/code/crc/crc.htm http://www.eagleairaust.com.au/code/crc16.htm www.s-direktnet.de/homepages/neumann/Data/Michael/Algorithmen/Crc/Crc16.cpp members.dencity.com/jas/fravia/crctut1.htm ftp.std.com/obi/Standards/FileTransfer/XMODEM-CRC.NOTE.1 www.ross.net/crc/links.html www.smbus.org/faq/crc8Applet.htm (JAVA CRC-8 calculator) hyperarchive.lcs.mit.edu/HyperArchive/Archive/per/csmp/csmp-digest-v3-028.txt CRC-CCITT discussion more test case values www.teamone.com/selfhtml (JAVASCRIPT) www.netzwelt.com/selfhtml (JAVASCRIPT) www.rabich.de (JAVASCRIPT)
So have a nice time even in a reflected world :-) Sven Reifegerste