<?php
mt_srand(42);
echo generateKey();
function generateKey() {
return base64encode(randBuffer(48));
}
function base64encode($buf) {
$enc = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";
return $buf;
}
function randBuffer($n) {
//try {
//$buf = openssl_random_pseudo_bytes($n);
//} catch (Exception $e) {
$buf = "";
for ($i = 0; $i < $n; $i++) {
$buf .= ord(mt_rand(0, 255));
}
//}
return $buf;
}
- Output for 7.1.0 - 7.1.25, 7.2.0 - 7.2.13, 7.3.0 - 7.3.1
- 494957494955495049495050555056495749494949534956504951494949504950535050505652505350495050495049
- Output for 5.2.1 - 5.2.17, 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.38, 7.0.0 - 7.0.33
- 495050505453494951495050494951494951554953505049525053505248525755574949495355495749515049554949
- Output for 4.3.0 - 4.3.11, 4.4.0 - 4.4.9, 5.0.0 - 5.0.5, 5.1.0 - 5.1.6, 5.2.0
- 495457505049495050505449524949565049545749494949494850494951574950505350504949505049505050514953
preferences:
243.91 ms | 402 KiB | 288 Q