Re: integer sequence randomization



On Oct 29, 8:17 am, "tomas.kejz...@xxxxxxxxx"
<tomas.kejz...@xxxxxxxxx> wrote:
Hi,

I am facing the following problem: I have a database filled with
thousands of records (tickets) distinguished by ther ID. I need to
find a way to generate unique but random integers, preferably based on
IDs of the records and these will work as barcodes (they have to be
"random" so that anyone having one ticket could not guess what is the
other barcode). We've tried generating random numbers and then
checking them against the ones we already have in our database, but
this (obviously) is getting slower and slower as the database is
getting bigger.

I've tried to investigate some possibilities of "randomizing" IDs
according to given rules (1 becomes 3,...), but the resulting sequence
is not "random" enough. Can anyone point me to a possible solution?

Thanks very much, Tom.

I am guessing you have created a field in your data base that
increments each time you get another person entry if not you should.
Never provide that to the people seeing it instead feed that number
into a pseudo random generator and provide that number instead. It is
a fairly common method used for user authentication when people sign
up for an account. You know when they send that email out from a
website says go to this page to validate you signed up for an account
here and the web pages has long random number. Yea that number is
usually the pseudo random number dumped into md5. So technically you
don't even need to store it because you know what user account they
are and they don't you can run the algorithm and work out if they
provided the correct info.

.