Re: Re: please help.. serial number generator
| From: | leo g. divinagracia iii | Date: | Wed, 31 Jul 2002 00:49:46 +0000 |
| Subject: | Re: Re: please help.. serial number generator | ||
| References: | 1 2 3 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-20915@lists.php.net to get a copy of this message | ||
use the MD5 function and just take the 1st 10 chars or better yet, once you have
the MD5 value, use a wacky routine to take the first 10 odd position values...
since each time you run the function, it will always return the same value
(given the same string parameter...).
rainydays_sunshine@hotmail.com wrote:
> I need to create some kind of 10 digits serial number where I can generate
> and check that it is valid. Sort of like a checksum..
> "Jj Harrison" <webmaster@tececo.com> wrote in message
> news:20020730085118.73595.qmail@pb1.pair.com...
> > if u are looking for a simple random string try this php:
> >
> > echo md5(time());
> >
> > or md5() a random number your choice.
> >
> > md5() genetates a one way non-reversable hash. which could be kept in a
> db.
> >
> > here is an example of the md5 hash of my library card number:
> > 11d560821fb027c227d837df53a5a73a
> >
> > md5() is often used to store passwords and make them non-viewable.
> >
> > if you are just looking for a unique number an auto-increment coloumn in
> > mysql or what ever should do it.
> >
> >
> > --
> > JJ Harrison
> > webmaster@tececo.com
> > www.tececo.com
> >
> > "Rainydays Sunshine" <rainydays_sunshine@hotmail.com> wrote in message
> > news:20020730070037.88410.qmail@pb1.pair.com...
> > > Any ideas how to generate a unique serial number that you can check that
> > > it's valid..
> > >
> > > Thanks...
> > >
> > >
> >
> >
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
--
Leo G. Divinagracia III
ldivinag@csuhayward.edu