Cartalyst\Sentinel\Hashing\HasherInterface::hash PHP Method

hash() public method

Hash the given value.
public hash ( string $value ) : string
$value string
return string
    public function hash($value);

Usage Example

 /**
  * Fills a user with the given credentials, intelligently.
  *
  * @param  \Cartalyst\Sentinel\Users\UserInterface  $user
  * @param  array  $credentials
  * @return void
  */
 public function fill(UserInterface $user, array $credentials)
 {
     $this->fireEvent('sentinel.user.filling', compact('user', 'credentials'));
     $loginNames = $user->getLoginNames();
     list($logins, $password, $attributes) = $this->parseCredentials($credentials, $loginNames);
     if (is_array($logins)) {
         $user->fill($logins);
     } else {
         $loginName = reset($loginNames);
         $user->fill([$loginName => $logins]);
     }
     $user->fill($attributes);
     if (isset($password)) {
         $password = $this->hasher->hash($password);
         $user->fill(compact('password'));
     }
     $this->fireEvent('sentinel.user.filled', compact('user', 'credentials'));
 }
HasherInterface