HEX
Server: Apache
System: Linux s198.coreserver.jp 5.15.0-151-generic #161-Ubuntu SMP Tue Jul 22 14:25:40 UTC 2025 x86_64
User: nagasaki (10062)
PHP: 7.1.33
Disabled: NONE
Upload Files
File: //opt/remi/php73/root/usr/share/doc/pecl/crypto/examples/rand.php
<?php
use Crypto\Rand;

/* this is just for testing - you should use a proper random seed
   or nothing as it is seeded from RAND_poll anyway */
$seed = str_repeat("a", 32);
Rand::seed($seed, 32);
$is_strong = false;
$bytes = Rand::generate(100, false, $is_strong);
Rand::cleanup();
echo "STRONG: " . ($is_strong ? 'yes' : 'no') . PHP_EOL;
echo base64_encode($bytes) . PHP_EOL;