PDA

Click to See Complete Forum and Search --> : Generate a check digit (3 figure)


Matt_T_hat
May 22nd, 2003, 03:36 AM
I have a three figure ID code that users enter. (Less than one thousand) this integer number must be passed to the function and a check code returned.

This code must be vertually unguessable and very unlikely to be entered by accident.

This is part of a security system for signing up new users.

Any ideas for a good formula? It's got to stop the user from useing the softwear with out phoneing head office for their unique ID.

marnitzg
May 25th, 2003, 05:01 PM
If its only 3 digits you could use a hash. Something like MD5 maybe.

sql_lall
May 26th, 2003, 04:32 AM
How many 3-digit IDs do you need?
I mean, if you want 1000 of them, then ur outa luck :p

But, if you only are wanting to have around 10 or less, then you could just convert the base of the 3-digit number (i.e. pass 137 (base 10) and function spits out whether 137 (base 26) is divisible by some number)

Otherwise, you could just have an array of numbers which are IDs, and check it against this. This would be truly unguessable, as you yourself made them.

Matt_T_hat
May 29th, 2003, 03:52 AM
Sigh... you could be right (both)...

What I was looking to try and do ammounts to an unlock key based on the F_id which would (should) be unique per user as it is assigned by HO at distribution time.