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) {
|
function make_secret($Length = 32) {
|
||||||
$Secret = '';
|
$NumBytes = (int) round($Length / 2);
|
||||||
$Chars = 'abcdefghijklmnopqrstuvwxyz0123456789';
|
$Secret = bin2hex(openssl_random_pseudo_bytes($NumBytes));
|
||||||
for ($i = 0; $i < $Length; $i++) {
|
return substr($Secret, 0, $Length);
|
||||||
$Rand = mt_rand(0, strlen($Chars) - 1);
|
|
||||||
$Secret .= substr($Chars, $Rand, 1);
|
|
||||||
}
|
|
||||||
return str_shuffle($Secret);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function is_number($Str) {
|
function is_number($Str) {
|
||||||
|
@ -110,13 +110,9 @@ function display_array($Array, $DontEscape = array()) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function make_secret($Length = 32) {
|
function make_secret($Length = 32) {
|
||||||
$Secret = '';
|
$NumBytes = (int) round($Length / 2);
|
||||||
$Chars = 'abcdefghijklmnopqrstuvwxyz0123456789';
|
$Secret = bin2hex(openssl_random_pseudo_bytes($NumBytes));
|
||||||
for ($i = 0; $i < $Length; $i++) {
|
return substr($Secret, 0, $Length);
|
||||||
$Rand = mt_rand(0, strlen($Chars) - 1);
|
|
||||||
$Secret .= substr($Chars, $Rand, 1);
|
|
||||||
}
|
|
||||||
return str_shuffle($Secret);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Send a message to an IRC bot listening on SOCKET_LISTEN_PORT
|
// 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
|
* @return random alphanumeric string
|
||||||
*/
|
*/
|
||||||
public static function make_secret($Length = 32) {
|
public static function make_secret($Length = 32) {
|
||||||
$Secret = '';
|
$NumBytes = (int) round($Length / 2);
|
||||||
$Chars = 'abcdefghijklmnopqrstuvwxyz0123456789';
|
$Secret = bin2hex(openssl_random_pseudo_bytes($NumBytes));
|
||||||
$CharLen = strlen($Chars) - 1;
|
return substr($Secret, 0, $Length);
|
||||||
for ($i = 0; $i < $Length; ++$i) {
|
|
||||||
$Secret .= $Chars[mt_rand(0, $CharLen)];
|
|
||||||
}
|
|
||||||
return $Secret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user