Pop\Crypt\Crypt::create PHP Method

create() public method

Method to create the hashed value
public create ( string $string ) : string
$string string
return string
    public function create($string)
    {
        $hash = null !== $this->salt ? crypt($string, $this->salt) : crypt($string);
        return $hash;
    }

Usage Example

示例#1
0
 public function testCrypt()
 {
     $crypt = new Crypt\Crypt();
     $crypt->setSalt('Test Salt');
     $this->assertEquals('Test Salt', $crypt->getSalt());
     $hash = $crypt->create('12password34');
     $this->assertTrue($crypt->verify('12password34', $hash));
 }
All Usage Examples Of Pop\Crypt\Crypt::create