public static function crypt(string $input, string $password, string $algo = 'sha512'): string
    {
        $chunks = \str_split($input, Str::hashSize($algo));

        $length = Str::strlen($input);
        
        foreach ($chunks as $i => &$chunk) {
            $chunk = $chunk ^ \hash_hmac($algo, $password . $length, $i, true);
        }

        return \implode($chunks);
    }