Posted on

chisel seeds

(sorry for the funky line breaks but I have once
more reported the bug on this issue of word
wrapping to no avail)

mt_srand effectively performs a modulo % 2147483648 on positive integers over 32 bits, but with negative integers it instead adds 2147483648 to the value it gets.

// the following applies only to the requesting client
$sReq = implode ( unpack (

(sorry for the funky line breaks but I have once
more reported the bug on this issue of word
wrapping to no avail)

mt_srand effectively performs a modulo % 2147483648 on positive integers over 32 bits, but with negative integers it instead adds 2147483648 to the value it gets.

What about this for an example.

Примеры

mt_srand(10); //start of your algorithm equals seeding set back to 10
for($i=0;$i<10;$i++) <
echo mt_rand();
>

Seeds with equal results:
2147483649 == 1
2147483648 == 0
2147483647 == -1
-2147483646 == 2
-2147483647 == 1
-2147483648 == 0

@ fasaxc at yahoo dot com:

Список изменений

Переинициализирует генератор случайных чисел параметром seed или случайным числом, если seed не указан.

for ( $testseed = $min ; $testseed < $max ; $testseed ++)
<
mt_srand ( $testseed );
$r = mt_rand ();
printf ( “mt_srand( 0x%08x ): mt_rand() == 0x%08x == %dn” , $testseed , $r , $r );
>

SERVER [ ‘REMOTE_ADDR’ ].

(sorry for the funky line breaks but I have once
more reported the bug on this issue of word
wrapping to no avail)

mt_srand effectively performs a modulo % 2147483648 on positive integers over 32 bits, but with negative integers it instead adds 2147483648 to the value it gets.

Функция не возвращает значения после выполнения.

Примеры

This means that your script will produce values of poor random quality if it’s always run at a predictable time, for example by crontab. In that case it may be a good idea to initialise it manually from a cryptographically secure source.

mt_srand(10); //start of your algorithm equals seeding set to 10
for($i=0;$i<10;$i++) <
echo mt_rand();
>

// get a random value based on the uniqueness of the seed above
mt_srand ( $sSeed ); // seed the random num gen

Список изменений

/*—————————————————
Radomizing the random data with fixed data for
the user and location If return value maximum
is set to zero (0) the function uses mt_getrandmax
If both retMin and retMax is zero (0) the function
uses mt_rand w.o. limits
*—————————————————-*/
function local_prgn ( $retMin = 0 , $retMax = 0 ) <
// first get the session id of the request session
$sSrv = session_id ();

Intending to use it in passing a “semi-guaranteed”
properly seeded random number to a client, then to
capture input from the user which must be encrypted
client side before being sent to the server again
a) during the same session and,
b) within a set time limit.

SERVER [ ‘REQUEST_TIME’ ]), ” );

Примеры

If you want truly random numbers, use a truly random source. Your system is rather unwieldy when you can simply call openssl_random_pseudo_bytes() for good randomness. Don’t use microtime as a source of randomness.

// the following is valid only on the current server
$sSrv = implode ( unpack (

(sorry for the funky line breaks but I have once
more reported the bug on this issue of word
wrapping to no avail)

mt_srand effectively performs a modulo % 2147483648 on positive integers over 32 bits, but with negative integers it instead adds 2147483648 to the value it gets.

// the following applies only to the requesting client
$sReq = implode ( unpack (

(sorry for the funky line breaks but I have once
more reported the bug on this issue of word
wrapping to no avail)

mt_srand effectively performs a modulo % 2147483648 on positive integers over 32 bits, but with negative integers it instead adds 2147483648 to the value it gets.

What about this for an example.

Примеры

mt_srand(10); //start of your algorithm equals seeding set back to 10
for($i=0;$i<10;$i++) <
echo mt_rand();
>

Seeds with equal results:
2147483649 == 1
2147483648 == 0
2147483647 == -1
-2147483646 == 2
-2147483647 == 1
-2147483648 == 0

@ fasaxc at yahoo dot com:

Список изменений

Переинициализирует генератор случайных чисел параметром seed или случайным числом, если seed не указан.

for ( $testseed = $min ; $testseed < $max ; $testseed ++)
<
mt_srand ( $testseed );
$r = mt_rand ();
printf ( “mt_srand( 0x%08x ): mt_rand() == 0x%08x == %dn” , $testseed , $r , $r );
>

SERVER [ ‘REMOTE_ADDR’ ].

(sorry for the funky line breaks but I have once
more reported the bug on this issue of word
wrapping to no avail)

mt_srand effectively performs a modulo % 2147483648 on positive integers over 32 bits, but with negative integers it instead adds 2147483648 to the value it gets.

Функция не возвращает значения после выполнения.

Примеры

This means that your script will produce values of poor random quality if it’s always run at a predictable time, for example by crontab. In that case it may be a good idea to initialise it manually from a cryptographically secure source.

mt_srand(10); //start of your algorithm equals seeding set to 10
for($i=0;$i<10;$i++) <
echo mt_rand();
>

// get a random value based on the uniqueness of the seed above
mt_srand ( $sSeed ); // seed the random num gen

Список изменений

/*—————————————————
Radomizing the random data with fixed data for
the user and location If return value maximum
is set to zero (0) the function uses mt_getrandmax
If both retMin and retMax is zero (0) the function
uses mt_rand w.o. limits
*—————————————————-*/
function local_prgn ( $retMin = 0 , $retMax = 0 ) <
// first get the session id of the request session
$sSrv = session_id ();

Intending to use it in passing a “semi-guaranteed”
properly seeded random number to a client, then to
capture input from the user which must be encrypted
client side before being sent to the server again
a) during the same session and,
b) within a set time limit.

SERVER [ ‘REQUEST_TIME’ ]), ” );

Примеры

If you want truly random numbers, use a truly random source. Your system is rather unwieldy when you can simply call openssl_random_pseudo_bytes() for good randomness. Don’t use microtime as a source of randomness.

Looks like mt_rand() gives same result for different seeds when the lowest bits are different only. Try this:

for more reading also see:
AES Rijndael enc/dec routines for javaScript
developed and tested by Herbert Hanewinkel,
http://www.hanewin.net/encrypt/aes/aes.htm

Список изменений

// get a SHA256 seed based on the current values
$sSeed = SHA256 ( $sSrv , $sReq );

That’s how it reads for me, anyway.

SERVER [ ‘SERVER_NAME’ ].

(sorry for the funky line breaks but I have once
more reported the bug on this issue of word
wrapping to no avail)

mt_srand effectively performs a modulo % 2147483648 on positive integers over 32 bits, but with negative integers it instead adds 2147483648 to the value it gets.

// the following applies only to the requesting client
$sReq = implode ( unpack (

(sorry for the funky line breaks but I have once
more reported the bug on this issue of word
wrapping to no avail)

mt_srand effectively performs a modulo % 2147483648 on positive integers over 32 bits, but with negative integers it instead adds 2147483648 to the value it gets.

What about this for an example.

Примеры

mt_srand(10); //start of your algorithm equals seeding set back to 10
for($i=0;$i<10;$i++) <
echo mt_rand();
>

Seeds with equal results:
2147483649 == 1
2147483648 == 0
2147483647 == -1
-2147483646 == 2
-2147483647 == 1
-2147483648 == 0

@ fasaxc at yahoo dot com:

Список изменений

Переинициализирует генератор случайных чисел параметром seed или случайным числом, если seed не указан.

for ( $testseed = $min ; $testseed < $max ; $testseed ++)
<
mt_srand ( $testseed );
$r = mt_rand ();
printf ( “mt_srand( 0x%08x ): mt_rand() == 0x%08x == %dn” , $testseed , $r , $r );
>

SERVER [ ‘REMOTE_ADDR’ ].

(sorry for the funky line breaks but I have once
more reported the bug on this issue of word
wrapping to no avail)

mt_srand effectively performs a modulo % 2147483648 on positive integers over 32 bits, but with negative integers it instead adds 2147483648 to the value it gets.

Функция не возвращает значения после выполнения.

Примеры

This means that your script will produce values of poor random quality if it’s always run at a predictable time, for example by crontab. In that case it may be a good idea to initialise it manually from a cryptographically secure source.

mt_srand(10); //start of your algorithm equals seeding set to 10
for($i=0;$i<10;$i++) <
echo mt_rand();
>

// get a random value based on the uniqueness of the seed above
mt_srand ( $sSeed ); // seed the random num gen

Список изменений

/*—————————————————
Radomizing the random data with fixed data for
the user and location If return value maximum
is set to zero (0) the function uses mt_getrandmax
If both retMin and retMax is zero (0) the function
uses mt_rand w.o. limits
*—————————————————-*/
function local_prgn ( $retMin = 0 , $retMax = 0 ) <
// first get the session id of the request session
$sSrv = session_id ();

Intending to use it in passing a “semi-guaranteed”
properly seeded random number to a client, then to
capture input from the user which must be encrypted
client side before being sent to the server again
a) during the same session and,
b) within a set time limit.

SERVER [ ‘REQUEST_TIME’ ]), ” );

Примеры

If you want truly random numbers, use a truly random source. Your system is rather unwieldy when you can simply call openssl_random_pseudo_bytes() for good randomness. Don’t use microtime as a source of randomness.

<?php
/*
calling the function, prepping the data to send to
the client. , who then uses it in a javascript
implementation of AES Encrypt.
*/

My conclusion: Don’t preset your seed to the same number all the time if you want “alternating random numbers”

Список изменений

I now understood seeding as a start-state of an algorithm. This algorithm generates a series of -following- pseudorandom numbers.
If you start generating from the same startvalue twice, you get the same series of random numbers twice in a row.

?>

This is a snapshop of the results:
.
mt_srand( 0xfffffffc ): mt_rand() == 0x0a223d97 == 170016151
mt_srand( 0xfffffffd ): mt_rand() == 0x0a223d97 == 170016151
mt_srand( 0xfffffffe ): mt_rand() == 0x350a9509 == 889885961
mt_srand( 0xffffffff ): mt_rand() == 0x350a9509 == 889885961
mt_srand( 0x00000000 ): mt_rand() == 0x71228443 == 1898087491
mt_srand( 0x00000001 ): mt_rand() == 0x71228443 == 1898087491
mt_srand( 0x00000002 ): mt_rand() == 0x4e0a2cdd == 1309289693
mt_srand( 0x00000003 ): mt_rand() == 0x4e0a2cdd == 1309289693
.

SERVER [ ‘SERVER_ADDR’ ]. $sSrv ), ” );

I found this occationally. I have no idea if it is a bug or not. In my real life I do not intend to use sequentional seeds. However, probably this may be important for somebody.

Список изменений

If you are new with seeding read my note.

I think Joe was a little confused by the wording. The note meant that implementations of mt_rand() before the change would generate a different set of pseudorandom numbers than would implementations of mt_rand() after the change for the same seed.

Chisel seeds

Germination 99.9% With a 99.9% germination rate you can be assured that quality is our priority. Hand selected seeds After cleaning and seperation using our hi-tech facilities the final check is all done by hand to ensure that you get the best seeds.

Big Buddha Seeds

What really makes Big Big Buddha Seeds stand out from the crowd is our vast experience when it comes to genetics. We breed, develop & improve our genetics every year to make sure that the your experience when purchasing Big Buddha Seeds products is first rate.

Big Buddha developed the ‘Big Buddha Cheese’ seed way back in 2002 and is recognised throughout the world as the creator of the Cheese seed. ‘Say Cheese’ Baby!