📄 efg's mathematics projects -- crc calculator.htm
字号:
href="javascript:if(confirm('http://www.brokersys.com/snippets/%20%20\n\nThis%20file%20was%20not%20retrieved%20by%20Teleport%20Pro,%20because%20it%20is%20addressed%20on%20a%20domain%20or%20path%20outside%20the%20boundaries%20set%20for%20its%20Starting%20Address.%20%20\n\nDo%20you%20want%20to%20open%20it%20from%20the%20server?'))window.location='http://www.brokersys.com/snippets/#section1group26'"
tppabs="http://www.brokersys.com/snippets/#section1group26">www.brokersys.com/snippets/#section1group26</A>
</P>
<P align=left>Robert Lee's optimized code for CRC computation:<BR><A
href="javascript:if(confirm('http://www.optimalcode.com/excrc.zip%20%20\n\nThis%20file%20was%20not%20retrieved%20by%20Teleport%20Pro,%20because%20it%20is%20addressed%20on%20a%20domain%20or%20path%20outside%20the%20boundaries%20set%20for%20its%20Starting%20Address.%20%20\n\nDo%20you%20want%20to%20open%20it%20from%20the%20server?'))window.location='http://www.optimalcode.com/excrc.zip'"
tppabs="http://www.optimalcode.com/excrc.zip">www.optimalcode.com/excrc.zip</A>
</P>
<P>Checksum-Algorithms: XOR16, XOR32, CRC32<BR><A
href="javascript:if(confirm('http://sunsite.icm.edu.pl/delphi/ftp/d20free/cipher.zip%20%20\n\nThis%20file%20was%20not%20retrieved%20by%20Teleport%20Pro,%20because%20it%20is%20addressed%20on%20a%20domain%20or%20path%20outside%20the%20boundaries%20set%20for%20its%20Starting%20Address.%20%20\n\nDo%20you%20want%20to%20open%20it%20from%20the%20server?'))window.location='http://sunsite.icm.edu.pl/delphi/ftp/d20free/cipher.zip'"
tppabs="http://sunsite.icm.edu.pl/delphi/ftp/d20free/cipher.zip">http://sunsite.icm.edu.pl/delphi/ftp/d20free/cipher.zip</A>
</P>
<P align=left>Steve Schafer's <A
href="http://plum.ia.polsl.gliwice.pl/~DIP/efg/Library/UseNet/1999/0117.txt"
tppabs="http://www.efg2.com/Lab/Library/UseNet/1999/0117.txt">UseNet Post</A>
showing calculation of CRC-32 Lookup Table</P><B><FONT face=geneva,arial size=2>
<P></FONT></B><FONT size=3>Bj鰎n Kriedemann's</FONT><FONT face=geneva,arial
size=2> </FONT><A
href="http://plum.ia.polsl.gliwice.pl/~DIP/efg/Library/UseNet/1999/1028a.txt"
tppabs="http://www.efg2.com/Lab/Library/UseNet/1999/1028a.txt">UseNet Post</A>
with CRC Unit from April 1997 DDJ: CRC16, XYZModemCRC16, CRC32</P>
<P align=left>Lars Truijens's <A
href="http://plum.ia.polsl.gliwice.pl/~DIP/efg/Library/UseNet/1999/0630b.txt"
tppabs="http://www.efg2.com/Lab/Library/UseNet/1999/0630b.txt">UseNet Post</A>
showing Delphi code for XModem CRC-16 (X<SUP>16</SUP> + X<SUP>12</SUP> +
X<SUP>5</SUP> + 1) with a Lookup Table</P>
<P align=left>CRC-16 (X<SUP>16</SUP>+X<SUP>15</SUP>+X<SUP>2</SUP>+1) without
lookup table, <A
href="javascript:if(confirm('http://www.ibrtses.com/delphi/dcrc.html%20%20\n\nThis%20file%20was%20not%20retrieved%20by%20Teleport%20Pro,%20because%20it%20is%20addressed%20on%20a%20domain%20or%20path%20outside%20the%20boundaries%20set%20for%20its%20Starting%20Address.%20%20\n\nDo%20you%20want%20to%20open%20it%20from%20the%20server?'))window.location='http://www.ibrtses.com/delphi/dcrc.html'"
tppabs="http://www.ibrtses.com/delphi/dcrc.html">www.ibrtses.com/delphi/dcrc.html</A>
.</P>
<P align=left>A CRC Calculator Unit provides three speed-optimized functions to
compute (or continue computation of) a Cyclic Redundancy Check (CRC). Applicable
to XModem protocol (16-bit CRC), SEA's "ARC" utility, PKZip (32-bit CRC) and
many others compatible software, <A
href="javascript:if(confirm('http://sunsite.icm.edu.pl/delphi/ftp/d10free/crc.zip%20%20\n\nThis%20file%20was%20not%20retrieved%20by%20Teleport%20Pro,%20because%20it%20is%20addressed%20on%20a%20domain%20or%20path%20outside%20the%20boundaries%20set%20for%20its%20Starting%20Address.%20%20\n\nDo%20you%20want%20to%20open%20it%20from%20the%20server?'))window.location='http://sunsite.icm.edu.pl/delphi/ftp/d10free/crc.zip'"
tppabs="http://sunsite.icm.edu.pl/delphi/ftp/d10free/crc.zip">http://SunSITE.ICM.edu.pl/delphi/ftp/d10free/crc.zip</A>
.</P>
<P align=left>SWAG (Software Archive Group) CRC Snipets: Includes various
CRC and Checksum routines<BR><A
href="javascript:if(confirm('http://www.gdsoft.com/swag/downloads.html%20%20\n\nThis%20file%20was%20not%20retrieved%20by%20Teleport%20Pro,%20because%20it%20is%20addressed%20on%20a%20domain%20or%20path%20outside%20the%20boundaries%20set%20for%20its%20Starting%20Address.%20%20\n\nDo%20you%20want%20to%20open%20it%20from%20the%20server?'))window.location='http://www.gdsoft.com/swag/downloads.html'"
tppabs="http://www.gdsoft.com/swag/downloads.html">www.gdsoft.com/swag/downloads.html</A>
<BR><A
href="javascript:if(confirm('http://www.gdsoft.com/swag/crc.zip%20%20\n\nThis%20file%20was%20not%20retrieved%20by%20Teleport%20Pro,%20because%20it%20is%20addressed%20on%20a%20domain%20or%20path%20outside%20the%20boundaries%20set%20for%20its%20Starting%20Address.%20%20\n\nDo%20you%20want%20to%20open%20it%20from%20the%20server?'))window.location='http://www.gdsoft.com/swag/crc.zip'"
tppabs="http://www.gdsoft.com/swag/crc.zip">www.gdsoft.com/swag/crc.zip</A>
(requires "<A
href="javascript:if(confirm('ftp://ftp.gdsoft.com/pub/swag/swag.zip%20%20\n\nThis%20file%20was%20not%20retrieved%20by%20Teleport%20Pro,%20because%20it%20is%20addressed%20on%20a%20domain%20or%20path%20outside%20the%20boundaries%20set%20for%20its%20Starting%20Address.%20%20\n\nDo%20you%20want%20to%20open%20it%20from%20the%20server?'))window.location='ftp://ftp.gdsoft.com/pub/swag/swag.zip'"
tppabs="ftp://ftp.gdsoft.com/pub/swag/swag.zip">Reader</A>" program to view)</P>
<P align=left>Algorithm of CRC-32 calculation for file<BR><A
href="javascript:if(confirm('http://www.scalabium.com/faq/dct0048.htm%20%20\n\nThis%20file%20was%20not%20retrieved%20by%20Teleport%20Pro,%20because%20it%20is%20addressed%20on%20a%20domain%20or%20path%20outside%20the%20boundaries%20set%20for%20its%20Starting%20Address.%20%20\n\nDo%20you%20want%20to%20open%20it%20from%20the%20server?'))window.location='http://www.scalabium.com/faq/dct0048.htm'"
tppabs="http://www.scalabium.com/faq/dct0048.htm">www.scalabium.com/faq/dct0048.htm</A> </P>
<P align=left>"Calculating CRC Checksums in C++" by Colin Mahoney in <A
href="javascript:if(confirm('http://www.cuj.com/archive/1706%20%20\n\nThis%20file%20was%20not%20retrieved%20by%20Teleport%20Pro,%20because%20it%20is%20addressed%20on%20a%20domain%20or%20path%20outside%20the%20boundaries%20set%20for%20its%20Starting%20Address.%20%20\n\nDo%20you%20want%20to%20open%20it%20from%20the%20server?'))window.location='http://www.cuj.com/archive/1706'"
tppabs="http://www.cuj.com/archive/1706">June 1999</A> <EM>C/C++ Users
Journal.</EM></P>
<P>Algorithms Alfresco: Whirlpool (CRC Algorithms), Julian Bucknall unravels
CRC, <EM>Delphi Magazine</EM>, <A
href="javascript:if(confirm('http://www.itecuk.com/delmag/conts/conts48.htm%20%20\n\nThis%20file%20was%20not%20retrieved%20by%20Teleport%20Pro,%20because%20it%20is%20addressed%20on%20a%20domain%20or%20path%20outside%20the%20boundaries%20set%20for%20its%20Starting%20Address.%20%20\n\nDo%20you%20want%20to%20open%20it%20from%20the%20server?'))window.location='http://www.itecuk.com/delmag/conts/conts48.htm'"
tppabs="http://www.itecuk.com/delmag/conts/conts48.htm">Issue 48</A>, August
1999. <A
href="javascript:if(confirm('http://www.itecuk.com/delmag/disks/dmag48.zip%20%20\n\nThis%20file%20was%20not%20retrieved%20by%20Teleport%20Pro,%20because%20it%20is%20addressed%20on%20a%20domain%20or%20path%20outside%20the%20boundaries%20set%20for%20its%20Starting%20Address.%20%20\n\nDo%20you%20want%20to%20open%20it%20from%20the%20server?'))window.location='http://www.itecuk.com/delmag/disks/dmag48.zip'"
tppabs="http://www.itecuk.com/delmag/disks/dmag48.zip">Download Disk</A>.</P>
<P>Checksum example (assembly language)<BR><A
href="javascript:if(confirm('http://www.delphi3000.com/article.asp?ID=298 \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address. \n\nDo you want to open it from the server?'))window.location='http://www.delphi3000.com/article.asp?ID=298'"
tppabs="http://www.delphi3000.com/article.asp?ID=298">www.delphi3000.com/article.asp?ID=298</A>
</P>
<P>Split and Join (use CRCs to verify copy is correct after a file is
split into separate floppy-size files and later rejoined)<BR><A
href="javascript:if(confirm('http://www.undu.com/Articles/010511d.html%20%20\n\nThis%20file%20was%20not%20retrieved%20by%20Teleport%20Pro,%20because%20it%20is%20addressed%20on%20a%20domain%20or%20path%20outside%20the%20boundaries%20set%20for%20its%20Starting%20Address.%20%20\n\nDo%20you%20want%20to%20open%20it%20from%20the%20server?'))window.location='http://www.undu.com/Articles/010511d.html'"
tppabs="http://www.undu.com/Articles/010511d.html">www.undu.com/Articles/010511d.html</A>
</P>
<P align=left><A name=Literature></A><BIG><STRONG>Useful
literature:</STRONG></BIG><BR>"Procedure for Computing CRC-32 Values,"
<EM>Microsoft Systems Journal</EM>, March 1995, pp. 107-108.</P>
<P align=left>"Byte-wise CRC Calculations" by Aram Perez in <EM>IEEE Micro</EM>,
June 1983, pp. 40-50. Shows how to create a lookup table which is the best way
to implement in software (versus the shifts that are done when implemented in
hardware). </P>
<P align=left>"A Tutorial on CRC Computations" by Tenkasi V. Ramabadran and
Sunil S. Gaitonde in <EM>IEEE Micro</EM>, August 1988, pp. 62-75.</P>
<P align=left>"Cyclic Redundancy Checks for Data Integrity or Identity" by
William H. Press and Saul A. Teukolsky, <EM>Computers in Physics</EM>, Jul/Aug
1989, pp. 88-91.</P>
<DIV align=center>
<CENTER>
<TABLE border=1>
<TBODY>
<TR>
<TD><STRONG>Standard Name</STRONG></TD>
<TD>CRC-CCITT (X25)</TD>
<TD>CRC-16 (SDLC)</TD>
<TD>CRC-32 (Ethernet)</TD></TR>
<TR>
<TD><STRONG>Width</STRONG></TD>
<TD>16 bits</TD>
<TD>16 bits</TD>
<TD>32 bits</TD></TR>
<TR>
<TD><STRONG>Generator Polynomial</STRONG></TD>
<TD vAlign=top>10001000000100001
<P>x<SUP>16 </SUP>+ x<SUP>12</SUP> + x<SUP>5</SUP> + 1</P></TD>
<TD vAlign=top>11000000000000101
<P>x<SUP>16</SUP> + x<SUP>15</SUP> + x<SUP>2</SUP> + 1</P></TD>
<TD vAlign=top>100000100110000010001110110110111
<P>x<SUP>32</SUP> + x<SUP>26</SUP> + x<SUP>23</SUP> + x<SUP>22</SUP> +
x<SUP>16</SUP> + x<SUP>12</SUP> + x<SUP>11</SUP> + <BR>x<SUP>10</SUP>
+ x<SUP>8</SUP> + x<SUP>7</SUP> + x<SUP>5</SUP> + x<SUP>4</SUP> +
x<SUP>2</SUP> + x + 1</P></TD></TR>
<TR>
<TD><STRONG>Initial remainder</STRONG></TD>
<TD>0xFFFF</TD>
<TD>0x0000</TD>
<TD>0xFFFFFFFF</TD></TR>
<TR>
<TD><STRONG>Final XOR value</STRONG></TD>
<TD>0x0000</TD>
<TD>0x0000</TD>
<TD>0xFFFFFFFF</TD></TR></TBODY></TABLE></CENTER></DIV>
<P align=left>Other standard polynomials:<BR>CRC-12: x<SUP>12</SUP> +
x<SUP>11</SUP> + x<SUP>3</SUP> + x<SUP>2</SUP> + x + 1</P>
<P align=left><FONT size=4><STRONG>Conclusions<BR></STRONG></FONT>CRC values,
especially the CRC-32, are an extremely good way to verify the integrity of a
string or even a file.</P>
<HR>
<P align=left><FONT size=4><STRONG>Keywords</STRONG><BR></FONT>cyclic redundancy
check, CRC-16, CRC-32, APPTYPE CONSOLE, lookup table, XOR, Comp, Int64,
IntToHex, Addr</P>
<P align=left><FONT size=4><STRONG>Files<BR></STRONG></FONT>Delphi 2/3/4/5
Source and EXE (234 KB): <A
href="http://plum.ia.polsl.gliwice.pl/~DIP/efg/Mathematics/CRCDelphi.ZIP"
tppabs="http://www.efg2.com/Lab/Mathematics/CRCDelphi.ZIP">CRCDelphi.ZIP</A></P>
<P align=left>Borland C++ 5.02 "C" CRC-32 Source and EXE (45 KB): <A
href="javascript:if(confirm('http://www.efg2.com/Lab/Mathematics/CRCC.ZIP%20%20\n\nThis%20file%20was%20not%20retrieved%20by%20Teleport%20Pro,%20because%20the%20server%20reports%20that%20this%20file%20cannot%20be%20found.%20%20\n\nDo%20you%20want%20to%20open%20it%20from%20the%20server?'))window.location='http://www.efg2.com/Lab/Mathematics/CRCC.ZIP'"
tppabs="http://www.efg2.com/Lab/Mathematics/CRCC.ZIP">CRCC.ZIP</A><BR>Use the
"make file" to compile: <FONT face="Arial Narrow">make -f
crc32.mak</FONT><BR>(Modify <EM>.mak</EM> file to point to correct location of
<EM>wildargs.obj</EM>. The <EM>.mak</EM> file automatically performs a
test that the results will match those of PKZIP.) This command-line
utility can be used with wildcards to find the CRC-32 of files in a directory,
for example: <FONT face="Arial Narrow">crc32 *.*</FONT></P>
<P align=left>TP 5.5 program to <A
href="http://plum.ia.polsl.gliwice.pl/~DIP/efg/Mathematics/CRCTable16.pas.txt"
tppabs="http://www.efg2.com/Lab/Mathematics/CRCTable16.pas.txt">compute values
for CRC-16 lookup table</A>.</P>
<P align=left>Felipe Rocha Machado's <A
href="http://plum.ia.polsl.gliwice.pl/~DIP/efg/Mathematics/FelipeRochaMachado.TXT"
tppabs="http://www.efg2.com/Lab/Mathematics/FelipeRochaMachado.TXT">comments</A>
about printing 32-bit integers in D3.</P>
<P align=left>The Delphi 5 CDs (Version 3 through 5) have C code in
\Info\Extras\Zlib\Src\CRC32.C</P>
<HR>
<P align=center><FONT size=1>Links verified 17 Jan 2001<BR>Updated <!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %b %Y" startspan -->19
Jun 2001<!--webbot bot="Timestamp" endspan i-checksum="15063" --></FONT></P>
<P align=center><IMG src=""
tppabs="http://www.efg2.com/cgi-local/count.pl?L720CRC"><FONT size=1><BR>since
29 Nov 1998</FONT></P>
<P align=center><FONT size=1>This page is listed on the Google Web
Directory<BR> <A
href="javascript:if(confirm('http://directory.google.com/Top/Science/Math/Software%20%20\n\nThis%20file%20was%20not%20retrieved%20by%20Teleport%20Pro,%20because%20it%20is%20addressed%20on%20a%20domain%20or%20path%20outside%20the%20boundaries%20set%20for%20its%20Starting%20Address.%20%20\n\nDo%20you%20want%20to%20open%20it%20from%20the%20server?'))window.location='http://directory.google.com/Top/Science/Math/Software'"
tppabs="http://directory.google.com/Top/Science/Math/Software">http://directory.google.com/Top/Science/Math/Software</A>
</FONT></P></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -