Indexer refactor complete. This is going to need lots of testing!

This commit is contained in:
KZ
2015-07-27 01:03:51 +01:00
parent 33d85bc4f4
commit 51042e91fc
53 changed files with 1046 additions and 1892 deletions

View File

@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
@@ -21,5 +22,21 @@ namespace Jackett.Utils
return Encoding.UTF8.GetString(Convert.FromBase64String(str));
}
public static string Hash(string input)
{
// Use input string to calculate MD5 hash
MD5 md5 = System.Security.Cryptography.MD5.Create();
byte[] inputBytes = System.Text.Encoding.ASCII.GetBytes(input);
byte[] hashBytes = md5.ComputeHash(inputBytes);
// Convert the byte array to hexadecimal string
StringBuilder sb = new StringBuilder();
for (int i = 0; i < hashBytes.Length; i++)
{
sb.Append(hashBytes[i].ToString("X2"));
}
return sb.ToString();
}
}
}