예제 #1
0
/**
 *  Get a Random Token
 *  The RT is a 64 vhars hexadecimal value
 *  This function generates a unique random token for each call but call the
 *  server only once every 30 seconds.
 *  You should always use this function to get random token.
 * @access public
 */
function Swekey_GetFastRndToken()
{
    $res = Swekey_GetFastHalfRndToken();
    if (strlen($res) == 64) {
        return substr($res, 0, 32) . strtoupper(md5("Musbe Authentication Key" + mt_rand() + date(DATE_ATOM)));
    }
    return "";
}
예제 #2
0
파일: swekey.php 프로젝트: kornelek/lms
/**
 *  Get a Random Token
 *  The RT is a 64 vhars hexadecimal value
 *  This function generates a unique random token for each call but call the
 *  server only once every 30 seconds.
 *  You should always use this function to get random token.
 *  @access public
 */
function Swekey_GetFastRndToken()
{
    $res = Swekey_GetFastHalfRndToken();
    if (strlen($res) == 64) {
        // Avoid a E_NOTICE when strict is enabled
        if (function_exists('date_default_timezone_set')) {
            date_default_timezone_set('Greenwich');
        }
        return substr($res, 0, 32) . strtoupper(md5("Musbe Authentication Key" . mt_rand() . date(DATE_ATOM)));
    }
    return "";
}