Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to check two files for record duplication
Message
From
21/06/2010 16:45:49
 
 
To
21/06/2010 12:30:59
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01469886
Message ID:
01470043
Views:
50
>>Creating an extra field filled with SYS(2017) and then comparing that field seems to work. I am double checking. Will let you know results.
>>
>>Thanks Naomi and Hilmar,
>>
>>Alex
>
>It works this way. If you don't find the checksum of a record you want to add, in the history table, then you know for sure that you can add the record.
>
>If you do find the checksum in the history table, you have to do additional verifications, to see whether all the values are, indeed, the same. It is possible that different sets of values give the same hash. With a 32-bit checksum, the probability for this happening for a single record is very small (1 / 2^32), but if you add 1000 records, and already have 100,000 records in the history table... well, you can multiply the probability of getting a conflict on SOME set of records (even if they are all different) by 1000 x 100,000 in this example.

Thanks for the heads up. It is a good point.

After reading your comment I checked Craig Boyd's vfpencryption71.fll library which includes a HASHRECORD() function somewhat similar to SYS(2017) that offers seven secure hash algorithms that go from 16 to 64 *bytes* in length. Good enough for me in this case. I picked 32 bytes in length.

Alex
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform