Re: Hash function

From: Date: Mon, 09 Nov 2009 16:54:14 +0000
Subject: Re: Hash function
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-299747@lists.php.net to get a copy of this message
At 2:38 PM +0330 11/9/09, Ali Asghar Toraby Parizy wrote:
hi friends I need a hash function to build a Unique serial number ...
Try: http://php.net/manual/en/function.dbplus-getunique.php But use at your own risk. If you want a unique number try using a time stamp (i.e., time() ) in concert with a database. For example, grab a time, look for it in a database, if it's not there then use it. If it is there then repeat until you have that isn't. That way it's a unique number guaranteed. Cheers, tedd
Addition to that. When you find an unique number, use it AND store that in the database. Cheers, tedd -- ------- http://sperling.com http://ancientstones.com http://earthstones.com

« previous php.general (#299747) next »