protected _hashSecret ( string $key ) : string | ||
$key | string | The possibly too weak key. |
return | string | The hashed (raw) key. |
protected function _hashSecret($key)
{
$size = mcrypt_enc_get_key_size(static::$_resource);
if (strlen($key) >= $size) {
return $key;
}
return substr(hash('sha256', $key, true), 0, $size);
}