Horde_Token::generateId PHP 메소드

generateId() 공개 정적인 메소드

Generates a connection id and returns it.
public static generateId ( string $seed = '' ) : string
$seed string A unique ID to be included in the token.
리턴 string The generated id string.
    public static function generateId($seed = '')
    {
        return Horde_Url::uriB64Encode(pack('H*', hash('sha1', uniqid(mt_rand()) . $seed . (isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : ''))));
    }

Usage Example

예제 #1
0
파일: Horde.php 프로젝트: justinlyon/scc
 /**
  * Get a token for protecting a form.
  *
  * @since Horde 3.2
  */
 function getRequestToken($slug)
 {
     require_once 'Horde/Token.php';
     $token = Horde_Token::generateId($slug);
     $_SESSION['horde_form_secrets'][$token] = true;
     return $token;
 }
All Usage Examples Of Horde_Token::generateId
Horde_Token