encode($compare); } protected function salted_hash(string $password,string $algo,int $salt_size=8,string $salt=NULL): string { if (is_null($salt)) $salt = hex2bin(random_salt($salt_size)); return base64_encode(hash($algo,$password.$salt,true).$salt); } protected function salted_salt(string $source): string { $hash = base64_decode(substr($source,strlen(static::key)+2)); return substr($hash,strlen($hash)-static::salt/2); } }