Link to home
Start Free TrialLog in
Avatar of alexxx
alexxx

asked on

Serial number validation code

Can anyone send me working C code for some advanced serial number checking algorithm. I want certain number of serial numbers to be reserved in advance, it is not necessary to extract the user's name from it though. Thanks in advance.
Avatar of tovergaard
tovergaard

One common method to checking serial numbers is to use a hash algorithm. A hash algorithm is a one-way function, this means you calculate a sort of checksum, but it is not possible to calculate the serialnumber if the hash value is known.

I am sure you will the sourcecode to a hash algorithm can be found at the Internet.
Avatar of alexxx

ASKER

Thank you tovergaard. I'm sorry for not accepting your answer. If I use some sort of hash function (& check the calculated value against some unique predefined value) then how do I guarantee that I can find at least N valid serial numbers? What's more, to use this technique I need an algorithm to generate valid serial numbers with acceptable growth rate - straightforward iteration over all values and checking their hash value just won't do. I beleive the solution to this is to use some encryption technique based on prime numbers or something of the kind. Unfortunatly I have no time to get into all this theory, what I want is the C code which does this job more or less with a bit of explanation to get me started. Thank you.
ASKER CERTIFIED SOLUTION
Avatar of msmits
msmits

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial