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

hash() public method

{@inheritDoc}
public hash ( $value )
    public function hash($value)
    {
        if (!($hash = password_hash($value, PASSWORD_DEFAULT))) {
            throw new RuntimeException('Error hashing value. Check system compatibility with password_hash().');
        }
        return $hash;
    }

Usage Example

コード例 #1
0
 public function testSymbolsValue()
 {
     $hasher = new NativeHasher();
     $hashedValue = $hasher->hash('!"#$%^&*()-_,./:;<=>?@[]{}`~|');
     $this->assertTrue($hashedValue !== '!"#$%^&*()-_,./:;<=>?@[]{}`~|');
     $this->assertTrue($hasher->check('!"#$%^&*()-_,./:;<=>?@[]{}`~|', $hashedValue));
 }
NativeHasher