public function __construct($name = null) { if (Value::SetAndNotNull($name)) { $this->_name = $name; } else { do { $this->_name = UUID::Create(); } while (file_exists($this->GetLocalFile())); } }
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); }
/** * 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; }