On Thu, 24 May 2001, Aigars Grins wrote:

> > > *] I need to generate a RANDOM UNIQUE number for every new record. Is
> there an
> > > *] easy way to accomplish this inside of mySQL.
> > > *]
>
> What are the requirements for 'random' and 'unique'? Do you need some sort
> of cryptographic randomness? Does uniqueness be kept across tables?
>
> If you 'only' need a unque id you could you AUTO_INCREMENT. If you want
> uniqueness to carry over tables etc. you could take a look at the aproach
> made by the Apache module mod_unique_id. If you need a cryptographic
> randomness you should look into some litterature about the area so as to get
> a better understanding of what you truly need.


Would an MD5 encryption be another option?  Use a auto incrementing ID to
keep your records sorted, then the MD5 field for your unique randomness.

-- 
===============================================
Kip Turk                    phone: 915.234.5678
Systems Administrator           or 800.695.9016
Killer of Spam/Writer of Code/Penguin Proponent
West Central Net              fax: 915.656.0071
===============================================


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to