mirror of
https://github.com/WhatCD/Gazelle.git
synced 2024-12-12 18:36:29 +00:00
Empty commit
This commit is contained in:
parent
b572fbe921
commit
ef3be48650
10
api.php
10
api.php
@ -39,13 +39,9 @@ function error($Code) {
|
||||
}
|
||||
|
||||
function make_secret($Length = 32) {
|
||||
$Secret = '';
|
||||
$Chars = 'abcdefghijklmnopqrstuvwxyz0123456789';
|
||||
for ($i = 0; $i < $Length; $i++) {
|
||||
$Rand = mt_rand(0, strlen($Chars) - 1);
|
||||
$Secret .= substr($Chars, $Rand, 1);
|
||||
}
|
||||
return str_shuffle($Secret);
|
||||
$NumBytes = (int) round($Length / 2);
|
||||
$Secret = bin2hex(openssl_random_pseudo_bytes($NumBytes));
|
||||
return substr($Secret, 0, $Length);
|
||||
}
|
||||
|
||||
function is_number($Str) {
|
||||
|
@ -110,13 +110,9 @@ function display_array($Array, $DontEscape = array()) {
|
||||
}
|
||||
|
||||
function make_secret($Length = 32) {
|
||||
$Secret = '';
|
||||
$Chars = 'abcdefghijklmnopqrstuvwxyz0123456789';
|
||||
for ($i = 0; $i < $Length; $i++) {
|
||||
$Rand = mt_rand(0, strlen($Chars) - 1);
|
||||
$Secret .= substr($Chars, $Rand, 1);
|
||||
}
|
||||
return str_shuffle($Secret);
|
||||
$NumBytes = (int) round($Length / 2);
|
||||
$Secret = bin2hex(openssl_random_pseudo_bytes($NumBytes));
|
||||
return substr($Secret, 0, $Length);
|
||||
}
|
||||
|
||||
// Send a message to an IRC bot listening on SOCKET_LISTEN_PORT
|
||||
|
@ -360,13 +360,9 @@ public static function release_order_default_js(&$SiteOptions) {
|
||||
* @return random alphanumeric string
|
||||
*/
|
||||
public static function make_secret($Length = 32) {
|
||||
$Secret = '';
|
||||
$Chars = 'abcdefghijklmnopqrstuvwxyz0123456789';
|
||||
$CharLen = strlen($Chars) - 1;
|
||||
for ($i = 0; $i < $Length; ++$i) {
|
||||
$Secret .= $Chars[mt_rand(0, $CharLen)];
|
||||
}
|
||||
return $Secret;
|
||||
$NumBytes = (int) round($Length / 2);
|
||||
$Secret = bin2hex(openssl_random_pseudo_bytes($NumBytes));
|
||||
return substr($Secret, 0, $Length);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user