Server IP : 127.0.0.2 / Your IP : 3.144.200.28 Web Server : Apache/2.4.18 (Ubuntu) System : User : www-data ( ) PHP Version : 7.0.33-0ubuntu0.16.04.16 Disable Function : disk_free_space,disk_total_space,diskfreespace,dl,exec,fpaththru,getmyuid,getmypid,highlight_file,ignore_user_abord,leak,listen,link,opcache_get_configuration,opcache_get_status,passthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,php_uname,phpinfo,posix_ctermid,posix_getcwd,posix_getegid,posix_geteuid,posix_getgid,posix_getgrgid,posix_getgrnam,posix_getgroups,posix_getlogin,posix_getpgid,posix_getpgrp,posix_getpid,posix,_getppid,posix_getpwnam,posix_getpwuid,posix_getrlimit,posix_getsid,posix_getuid,posix_isatty,posix_kill,posix_mkfifo,posix_setegid,posix_seteuid,posix_setgid,posix_setpgid,posix_setsid,posix_setuid,posix_times,posix_ttyname,posix_uname,pclose,popen,proc_open,proc_close,proc_get_status,proc_nice,proc_terminate,shell_exec,source,show_source,system,virtual MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/www/html/vendor/fzaninotto/faker/src/Faker/Provider/ |
Upload File : |
<?php namespace Faker\Provider; class Uuid extends Base { /** * Generate name based md5 UUID (version 3). * @example '7e57d004-2b97-0e7a-b45f-5387367791cd' */ public static function uuid() { // fix for compatibility with 32bit architecture; each mt_rand call is restricted to 32bit // two such calls will cause 64bits of randomness regardless of architecture $seed = mt_rand(0, 2147483647) . '#' . mt_rand(0, 2147483647); // Hash the seed and convert to a byte array $val = md5($seed, true); $byte = array_values(unpack('C16', $val)); // extract fields from byte array $tLo = ($byte[0] << 24) | ($byte[1] << 16) | ($byte[2] << 8) | $byte[3]; $tMi = ($byte[4] << 8) | $byte[5]; $tHi = ($byte[6] << 8) | $byte[7]; $csLo = $byte[9]; $csHi = $byte[8] & 0x3f | (1 << 7); // correct byte order for big edian architecture if (pack('L', 0x6162797A) == pack('N', 0x6162797A)) { $tLo = (($tLo & 0x000000ff) << 24) | (($tLo & 0x0000ff00) << 8) | (($tLo & 0x00ff0000) >> 8) | (($tLo & 0xff000000) >> 24); $tMi = (($tMi & 0x00ff) << 8) | (($tMi & 0xff00) >> 8); $tHi = (($tHi & 0x00ff) << 8) | (($tHi & 0xff00) >> 8); } // apply version number $tHi &= 0x0fff; $tHi |= (3 << 12); // cast to string $uuid = sprintf( '%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x', $tLo, $tMi, $tHi, $csHi, $csLo, $byte[10], $byte[11], $byte[12], $byte[13], $byte[14], $byte[15] ); return $uuid; } }