本文整理汇总了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;
}