--- In [email protected], "Perry Kappetein" <pkappet...@...> wrote: > > Is it possible to get a CRC32 from a Longint? > > Can't figure out how. > > anyone knows more? >
I think you meant *calculate* a CRC from a longint. Don't forget that you need to "seed" the CRC generator with a starting value. Usually the seed is either 0 (zero) or -1, but you can use any value you like if you don't have to match some other algorithm. Next, you usually don't calculate a CRC on a single integer or longint. You usually loop through a block of integer values and calculate a Cyclic Redundancy Checksum (CRC) on the entire block. There are many places to find CRC algorithms. One is the old TurboPower libraries - I think Async Professional had some CRC utilities that I used to use. A more up to date library of CRC routines can be found at: http://www.utilmind.com/ Click on the "Delphi and BCB Components" link at the upper-left part of the page and then select the "1-10" link. Item #5 is the one you want - the CRC calculator. The specific function you want is UpdateCRC32 found in the CRC.PAS file. Hope this helps Kevin G. McCoy

