예제 #1
0
 public function getCodeSalt()
 {
     if (!$this->codeSalt) {
         return $this->codeSalt = \Eva\Stdlib\String\Hash::uniqueHash();
     }
     return $this->codeSalt;
 }
예제 #2
0
 public function getUserIdFromHash()
 {
     $code = $this->getCode();
     $bigInt = BigInteger::factory('bcmath');
     $userId = \Eva\Stdlib\String\Hash::shortHash($code, true);
     $userId = $bigInt->sub($userId, '100000000');
     return $userId;
 }
예제 #3
0
 public function getSalt()
 {
     $saltArray = \Eva\Stdlib\String\Hash::uniqueHash(true);
     array_pop($saltArray);
     return $this->salt ? $this->salt : ($this->salt = implode('', $saltArray));
 }
예제 #4
0
 /**
  * Returns only the new filename without moving it
  * But existing files will be erased when the overwrite option is true
  *
  * @param  string  $value  Full path of file to change
  * @param  boolean $source Return internal informations
  * @return string The new filename which has been set
  * @throws Exception\InvalidArgumentException If the target file already exists.
  */
 public function getNewName($value, $source = false, $fileinfo = null)
 {
     $rootpath = $this->rootpath;
     $path = $this->getPath();
     $filename = \Eva\Stdlib\String\Hash::uniqueHash();
     $fileextension = '';
     if (isset($fileinfo['name'])) {
         $fileextension = '.' . $this->getExtension($fileinfo['name']);
     }
     $filepath = $rootpath . \DIRECTORY_SEPARATOR . $path . $filename . $fileextension;
     $this->prepareDirectoryStructure($filepath);
     return $filepath;
 }
예제 #5
0
 public function getUrlName()
 {
     if (!$this->urlName) {
         return $this->urlName = \Eva\Stdlib\String\Hash::uniqueHash();
     }
 }
예제 #6
0
 public function getGroupKey()
 {
     if (!$this->groupKey) {
         return $this->groupKey = \Eva\Stdlib\String\Hash::uniqueHash();
     }
 }
예제 #7
0
 public function getMessageHash()
 {
     if (!$this->messageHash) {
         return $this->messageHash = \Eva\Stdlib\String\Hash::uniqueHash();
     }
 }
예제 #8
0
 public function getFieldKey()
 {
     if (!$this->fieldKey) {
         return $this->fieldKey = \Eva\Stdlib\String\Hash::uniqueHash();
     }
 }