public function create($string)
{
$hash = null;
$this->ivSize = mcrypt_get_iv_size($this->cipher, $this->mode);
$this->salt = null === $this->salt ? substr(str_replace('+', '.', base64_encode(String::random(32))), 0, $this->ivSize) : substr(str_replace('+', '.', base64_encode($this->salt)), 0, $this->ivSize);
$this->iv = mcrypt_create_iv($this->ivSize, $this->source);
$hash = mcrypt_encrypt($this->cipher, $this->salt, $string, $this->mode, $this->iv);
$hash = base64_encode($this->iv . $this->salt . '$' . $hash);
return $hash;
}