Re: [PHP] mt_rand() - the same forever?

2008-10-06 Thread Janek
On Mon, Oct 6, 2008 at 1:53 PM, Eric Butera <[EMAIL PROTECTED]> wrote: > On Sun, Oct 5, 2008 at 2:25 PM, Janek <[EMAIL PROTECTED]> wrote: >> I wonder whether I can rely on the stability of mt_srand() and >> mt_rand(). I want them to generate the same sequence for a fixed seed, >> regardless of PHP

Re: [PHP] mt_rand() - the same forever?

2008-10-06 Thread Eric Butera
On Sun, Oct 5, 2008 at 2:25 PM, Janek <[EMAIL PROTECTED]> wrote: > I wonder whether I can rely on the stability of mt_srand() and > mt_rand(). I want them to generate the same sequence for a fixed seed, > regardless of PHP version. Do you think I can trust it? > Janek > > -- > PHP General Mailing L

Re: [PHP] mt_rand() - the same forever?

2008-10-06 Thread Richard Heyes
> fair point; I've been trying to change my mindset on this of late, but there > is no replacement for simply writing you're own code. Well said. How many numbers are you likely to need? -- Richard Heyes HTML5 Graphing for FF, Chrome, Opera and Safari: http://www.phpguru.org/RGraph -- PHP Gen

Re: [PHP] mt_rand() - the same forever?

2008-10-06 Thread Nathan Rixham
Stut wrote: On 6 Oct 2008, at 10:58, Nathan Rixham wrote: Janek wrote: On Sun, Oct 5, 2008 at 10:05 PM, Ashley Sheridan <[EMAIL PROTECTED]> wrote: On Sun, 2008-10-05 at 21:57 +0200, Janek wrote: I know, but I *want* to seed it. My goal is to have a fixed pseudorandom sequence for each integer

Re: [PHP] mt_rand() - the same forever?

2008-10-06 Thread Stut
On 6 Oct 2008, at 10:58, Nathan Rixham wrote: Janek wrote: On Sun, Oct 5, 2008 at 10:05 PM, Ashley Sheridan <[EMAIL PROTECTED]> wrote: On Sun, 2008-10-05 at 21:57 +0200, Janek wrote: I know, but I *want* to seed it. My goal is to have a fixed pseudorandom sequence for each integer (seed) and I

Re: [PHP] mt_rand() - the same forever?

2008-10-06 Thread Nathan Rixham
Janek wrote: On Sun, Oct 5, 2008 at 10:05 PM, Ashley Sheridan <[EMAIL PROTECTED]> wrote: On Sun, 2008-10-05 at 21:57 +0200, Janek wrote: I know, but I *want* to seed it. My goal is to have a fixed pseudorandom sequence for each integer (seed) and I don't want those sequences to change regarding

Re: [PHP] mt_rand() - the same forever?

2008-10-05 Thread Jochem Maas
Janek schreef: > On Sun, Oct 5, 2008 at 10:05 PM, Ashley Sheridan > <[EMAIL PROTECTED]> wrote: >> On Sun, 2008-10-05 at 21:57 +0200, Janek wrote: >>> I know, but I *want* to seed it. My goal is to have a fixed >>> pseudorandom sequence for each integer (seed) and I don't want those >>> sequences to

Re: [PHP] mt_rand() - the same forever?

2008-10-05 Thread Janek
On Sun, Oct 5, 2008 at 10:05 PM, Ashley Sheridan <[EMAIL PROTECTED]> wrote: > On Sun, 2008-10-05 at 21:57 +0200, Janek wrote: >> I know, but I *want* to seed it. My goal is to have a fixed >> pseudorandom sequence for each integer (seed) and I don't want those >> sequences to change regarding PHP v

Re: [PHP] mt_rand() - the same forever?

2008-10-05 Thread Ashley Sheridan
On Sun, 2008-10-05 at 21:57 +0200, Janek wrote: > I know, but I *want* to seed it. My goal is to have a fixed > pseudorandom sequence for each integer (seed) and I don't want those > sequences to change regarding PHP version. > > Janek > > On Sun, Oct 5, 2008 at 9:52 PM, Richard Heyes <[EMAIL PRO

Re: [PHP] mt_rand() - the same forever?

2008-10-05 Thread Janek
I know, but I *want* to seed it. My goal is to have a fixed pseudorandom sequence for each integer (seed) and I don't want those sequences to change regarding PHP version. Janek On Sun, Oct 5, 2008 at 9:52 PM, Richard Heyes <[EMAIL PROTECTED]> wrote: >> I wonder whether I can rely on the stabilit

Re: [PHP] mt_rand() - the same forever?

2008-10-05 Thread Richard Heyes
> I wonder whether I can rely on the stability of mt_srand() and > mt_rand(). I want them to generate the same sequence for a fixed seed, > regardless of PHP version. Do you think I can trust it? > Janek Keep in mind (if you're not already) that mt_rand() doesn't technically need to be seeded. --

[PHP] mt_rand() - the same forever?

2008-10-05 Thread Janek
I wonder whether I can rely on the stability of mt_srand() and mt_rand(). I want them to generate the same sequence for a fixed seed, regardless of PHP version. Do you think I can trust it? Janek -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] mt_rand doesn't seem random enough

2002-10-14 Thread Phil Schwarzmann
Maybe I'm wrong on this but mt_rand doesn't seem to be random enough. I'm on a PHP 4.04 server and here's my code.. function make_seed() { list($usec, $sec) = explode(' ', microtime()); return (float) $sec + ((float) $usec * 10); } mt_srand(make_seed()); $randval = mt_rand(); I pul

[PHP] mt_rand()

2002-03-14 Thread Phillip S. Baker
Is there a way to seed the mt_rand function with numbers and letters to generate a good password of say 6-10 characters? Thanks Phillip -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php