Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to check two files for record duplication
Message
De
21/06/2010 16:45:49
 
 
À
21/06/2010 12:30:59
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Divers
Thread ID:
01469886
Message ID:
01470043
Vues:
63
>>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform