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:
parent
8a979bb5b9
commit
9362a18d60
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user