1
0
mirror of https://github.com/fzaninotto/Faker.git synced 2025-03-22 00:09:59 +01:00

32bit compat fix

Using PHP_INT_MAX caused uuid sequences that depend on word size.
This commit is contained in:
Maik Penz 2013-02-05 21:30:05 +01:00
parent 8a979bb5b9
commit 9362a18d60

View File

@ -10,7 +10,8 @@ class Uuid extends \Faker\Provider\Base
*/
public static function uuid()
{
$seed = mt_rand(0, PHP_INT_MAX);
// fix for compatibility with 32bit architecture; seed range restricted to 62bit
$seed = mt_rand(0, 2147483648) . '#' . mt_rand(0, 2147483648);
// Hash the seed and convert to a byte array
$val = md5($seed, true);