I just searched on excite.com for "crc calculations", and found a
few hits immediately. [Other search engines can probably also find
similar and/or identical pages]
ftp://ftp.rocksoft.com/clients/rocksoft/papers/crc_v3.txt looked
interesting and might be useful.
General computing stuff like this can almost always be found faster
on a search engine than asking on a newsgroup
Nathan Mates
--
<*> Nathan Mates - personal webpage http://www.visi.com/~nathan/
# Network Programmer, Battlezone 2: see http://www.pandemicstudios.com
# NOT speaking for Pandemic Studios or Activision, ONLY myself
# "What are the facts, and to how many decimal places?" -R.A. Heinlein
Try:
www.efg2.com/lab/Mathematics/CRC.htm
efg
_________________________________
efg's Computer Lab: www.efg2.com/lab
Delphi Books: www.efg2.com/lab/TechBooks/Delphi.htm
Earl F. Glynn E-Mail: Earl...@att.net
Overland Park, KS USA
Send me email and I'll send you a small C++ class for calculating CRCs
of any length between 1 and 32 bits. MSB
You probably wont be using VB, but it demonstrates the algorithm..
Function CalcCRC16(buffer As String) As String
Dim crc As Long
Dim lp As Integer
Dim temp As Long
crc = 0
For lp = 1 To Len(buffer)
crc = crc And 65535
temp = Asc(Mid(buffer, lp, 1))
crc = (crc Xor (temp * 256))
For I = 1 To 8
crc = crc And 65535
If ((crc And 32768) <> 0) Then
crc = (crc * 2) Xor 4129
Else
crc = crc * 2
End If
Next I
Next lp
CalcCRC16 = Hex(crc And 65535)
' Make Sure the padding is correct
If Len(CalcCRC16) = 2 Then
CalcCRC16 = "0" + CalcCRC16
End If
If Len(CalcCRC16) = 3 Then
CalcCRC16 = "0" + CalcCRC16
End If
End Function
Aaron and Rebecca wrote:
>
> x-no-archive: yes
>
> I want to calculate a CRC for the datafiles in a game I'm working on. Can
> anyone explain how that is done, or point me to a good on-line reference?
>
> Thanks,
> Aaron.
--
==================================================================
Jim Norton --- jim.n...@worldnet.att.net
If a President of the United States ever lied to the American people he
should resign," --- William Clinton, 1974 while running for the US House of
Representatives responding to a question about President Nixon.