diff options
Diffstat (limited to 'src/WixToolset.Data/Common.cs')
| -rw-r--r-- | src/WixToolset.Data/Common.cs | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/src/WixToolset.Data/Common.cs b/src/WixToolset.Data/Common.cs deleted file mode 100644 index f75ad33e..00000000 --- a/src/WixToolset.Data/Common.cs +++ /dev/null | |||
| @@ -1,40 +0,0 @@ | |||
| 1 | // Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. | ||
| 2 | |||
| 3 | namespace WixToolset.Data | ||
| 4 | { | ||
| 5 | using System; | ||
| 6 | using System.IO; | ||
| 7 | using System.Security.Cryptography; | ||
| 8 | using System.Text; | ||
| 9 | using System.Text.RegularExpressions; | ||
| 10 | using System.Xml.Linq; | ||
| 11 | |||
| 12 | internal static class Common | ||
| 13 | { | ||
| 14 | public const int IntegerNotSet = Int32.MinValue; | ||
| 15 | |||
| 16 | internal static readonly XNamespace W3SchemaPrefix = "http://www.w3.org/"; | ||
| 17 | |||
| 18 | internal static readonly string[] ReservedFileNames = { "CON", "PRN", "AUX", "NUL", "COM1", "COM2", "COM3", "COM4", "COM5", "COM6", "COM7", "COM8", "COM9", "LPT1", "LPT2", "LPT3", "LPT4", "LPT5", "LPT6", "LPT7", "LPT8", "LPT9" }; | ||
| 19 | |||
| 20 | internal static string GetFileHash(FileInfo fileInfo) | ||
| 21 | { | ||
| 22 | byte[] hashBytes; | ||
| 23 | using (SHA1Managed managed = new SHA1Managed()) | ||
| 24 | { | ||
| 25 | using (FileStream stream = fileInfo.OpenRead()) | ||
| 26 | { | ||
| 27 | hashBytes = managed.ComputeHash(stream); | ||
| 28 | } | ||
| 29 | } | ||
| 30 | |||
| 31 | StringBuilder sb = new StringBuilder(); | ||
| 32 | for (int i = 0; i < hashBytes.Length; i++) | ||
| 33 | { | ||
| 34 | sb.AppendFormat("{0:X2}", hashBytes[i]); | ||
| 35 | } | ||
| 36 | |||
| 37 | return sb.ToString(); | ||
| 38 | } | ||
| 39 | } | ||
| 40 | } | ||
