NEVER USE this UUIDv4 generator
#!/usr/bin/env php | |
<?php | |
/** | |
* composer init && composer require cakephp/utility:^3.8 | |
* | |
* Try < PHP 5.6: ./genuuid4.php 65536 | sort | uniq -d | |
*/ | |
require 'vendor/autoload.php'; | |
use Cake\Utility\Text; | |
function make_seed() | |
{ | |
list($usec, $sec) = explode(' ', microtime()); | |
return $sec + $usec * 1000000; | |
} | |
$repeats = isset($argv[1]) ? (int)$argv[1] : 1; | |
for ($i = 0; $i < $repeats; $i++) { | |
mt_srand(make_seed()); // !! HAHAHAHAHHHAHA !! | |
echo Text::uuid() . "\n"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This comment has been minimized.
なるほど。 > メルセンヌツイスタはそんなに衝突しない - Qiita https://qiita.com/blackenedgold/items/52da300456b1e6e1365a