本文整理匯總了PHP中UUID::Create方法的典型用法代碼示例。如果您正苦於以下問題:PHP UUID::Create方法的具體用法?PHP UUID::Create怎麽用?PHP UUID::Create使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類UUID
的用法示例。
在下文中一共展示了UUID::Create方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: __construct
public function __construct($name = null)
{
if (Value::SetAndNotNull($name)) {
$this->_name = $name;
} else {
do {
$this->_name = UUID::Create();
} while (file_exists($this->GetLocalFile()));
}
}
示例2: hashUserNameAndPassword
public function hashUserNameAndPassword($_password)
{
$md5UserName = md5($this->userName);
$md5UserNameAndPassword = md5($this->userName . $_password);
//$userName.$password
$this->userNameHashed = hash('sha512', $md5UserName);
//userNameHash $sha512Ofmd5UserName
$this->personalSalt = hash("sha512", UUID::Create());
// dynamic salt personal salt sha512OfUUID
$this->passwordHashed = hash("sha512", STATIC_SALT . $md5UserNameAndPassword . $this->personalSalt . $this->userNameHashed);
}
示例3: CreateSecurityToken
/**
* Creates a Security token to secure a form against XSRF.
*/
public static function CreateSecurityToken()
{
$token = md5(utf8_encode(UUID::Create()));
return $_SESSION[SECURITY_TOKEN] = $token;
}