Friday, April 29, 2011

SourceSafe CRC calculation

Does anyone know what CRC checksum calculation is used in Microsoft SourceSafe? I want to calculate a checksum locally and compare it to the SourceSafe checksum.

I am using a CRC algorithm I found on the internet, but the seed or polynomial for the algorithm seems to be different for SourceSafe.

From stackoverflow
  • See this post:

    http://www.tesoga.com/vssnotes.html

    The blurb you may be looking for is:

    And the 16-bit CRC is mostly the standard algorithm. The one difference is that in my experience, CRCs typically start off by initializing the state to -1 (0xFFFFFFFF), accumulating, then returns the logical-NOT of the result. However, the VSS CRC logic initializes state to 0, and does not apply a logical-NOT at the end. Make certain you're using this technique when verifying any CRCs in the file. (Refer to VssCrc32() in CRC32.c for a working implementation.)

    The code he mentions is included in this zip file:

    http://www.teachsolaisgames.com/downloads/vsscode.zip

    Rine : Thanks a lot, I converted the C++ code to C# code and it works.

0 comments:

Post a Comment