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

hash() public method

{@inheritDoc}
public hash ( $value )
    public function hash($value)
    {
        $salt = $this->createSalt();
        return $salt . hash('sha256', $salt . $value);
    }

Usage Example

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