Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Compare 2 text files using checksum
Message
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01434733
Message ID:
01434767
Views:
108
This message has been marked as the solution to the initial question of the thread.
The SYS(2007) function can create crc16 or crc32 depending on the parameter passed. At most it can return 2^16-1 and 2^32-1 different values respectively. It's quite possible that 2 files can have the same checsum returned by SYS(2007). I would recomend to use one of the Hash algorithm that return longer digest of the file. You can use Craig Boyd's Vfpencryption.fll to generate MD5 or stronger hash.

>
>I can use FILETOSTR(), low level file access or FC.exe to compare 2 text files and know if they are same. I was curious if SYS(2007, FILETOSTR("MyFile.txt")) help me in this matter by comparing with a previously generated checksum value.
>
>My concern being small, say a single character, change to a big text file will guaranteed return a different checksum value?
>
>UPDATE, just thought this question. What are the chances that 2 different text files might return a same value?
>
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform