diff --git a/src/Microsoft.TestPlatform.ObjectModel/Utilities/EqtHash.cs b/src/Microsoft.TestPlatform.ObjectModel/Utilities/EqtHash.cs index 8005f1626a..641d3c6edc 100644 --- a/src/Microsoft.TestPlatform.ObjectModel/Utilities/EqtHash.cs +++ b/src/Microsoft.TestPlatform.ObjectModel/Utilities/EqtHash.cs @@ -7,9 +7,7 @@ namespace Microsoft.VisualStudio.TestPlatform.ObjectModel.Utilities using System.Diagnostics; using System.Diagnostics.CodeAnalysis; -#if NET46 -using System.Security.Cryptography; -#endif + using System.Security.Cryptography; /// /// Wrapper class for cryptographic hashing. @@ -25,11 +23,13 @@ public static class EqtHash public static Guid GuidFromString(string data) { Debug.Assert(data != null); -#if NET46 - using (HashAlgorithm provider = new SHA256CryptoServiceProvider()) -#else - using (var provider = System.Security.Cryptography.SHA256.Create()) -#endif + // Do NOT change the algorithm ever as this will have compat implications + // TC-TA team has a feature in VS where workitems are associated based on TestCase Ids + // If Algorithm changes, then all the bugs/workitems filed in TFS Server against a given TestCase become unassociated if IDs change + // Any algorithm or logic change must require a sign off from feature owners of above + // Also, TPV2 and TPV1 must use same Algorithm until the time TPV1 is completely deleted to be on-par + // If LUT or .Net core scenario uses TPV2 to discover, but if it uses TPV1 in Devenv, then there will be testcase matching issues + using (HashAlgorithm provider = SHA1.Create()) { byte[] hash = provider.ComputeHash(System.Text.Encoding.Unicode.GetBytes(data));