(f2e516dfe) v0.9.3.2
This commit is contained in:
@@ -8,6 +8,8 @@ namespace Barotrauma
|
||||
{
|
||||
public class Md5Hash
|
||||
{
|
||||
private static Regex removeWhitespaceRegex = new Regex(@"\s+", RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
||||
|
||||
public string Hash { get; private set; }
|
||||
|
||||
public string ShortHash { get; private set; }
|
||||
@@ -34,14 +36,13 @@ namespace Barotrauma
|
||||
|
||||
public Md5Hash(XDocument doc)
|
||||
{
|
||||
if (doc == null) return;
|
||||
|
||||
string docString = Regex.Replace(doc.ToString(), @"\s+", "");
|
||||
|
||||
if (doc == null) { return; }
|
||||
|
||||
string docString = removeWhitespaceRegex.Replace(doc.ToString(), "");
|
||||
|
||||
byte[] inputBytes = Encoding.ASCII.GetBytes(docString);
|
||||
|
||||
Hash = CalculateHash(inputBytes);
|
||||
|
||||
|
||||
Hash = CalculateHash(inputBytes);
|
||||
ShortHash = GetShortHash(Hash);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user