Extract a common SHA1 helper.

This commit is contained in:
Paul Chote
2016-09-08 17:45:04 +01:00
parent 0d54f2994f
commit 9e8b18e7be
5 changed files with 43 additions and 19 deletions

View File

@@ -16,12 +16,8 @@ using System.Drawing.Imaging;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Security.Cryptography;
using System.Text;
using OpenRA.FileSystem;
using OpenRA.Graphics;
using OpenRA.Network;
using OpenRA.Primitives;
using OpenRA.Support;
using OpenRA.Traits;
@@ -264,8 +260,7 @@ namespace OpenRA
// Take the SHA1
ms.Seek(0, SeekOrigin.Begin);
using (var csp = SHA1.Create())
return new string(csp.ComputeHash(ms).SelectMany(a => a.ToString("x2")).ToArray());
return CryptoUtil.SHA1Hash(ms);
}
}