Skip to content

Commit 121e1e4

Browse files
authored
Clarify SHA1 usage in ConvertStringToGuid method
Updated comment to clarify the use of SHA1 algorithm for compatibility with SCSM's SQL engine.
1 parent fa2aeac commit 121e1e4

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • SCSM.Support.Tools.mpb/MPResource/SCSM.Support.Tools.Library

SCSM.Support.Tools.mpb/MPResource/SCSM.Support.Tools.Library/Helpers.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public static class Helpers
2626
// equivalent of SQL: select cast( HashBytes('SHA1', N'AstringHere') AS uniqueidentifier)
2727
private static Guid SMSpecific_ConvertStringToGuid(string s)
2828
{
29-
var sha1 = System.Security.Cryptography.SHA1.Create();
29+
var sha1 = System.Security.Cryptography.SHA1.Create(); // CodeQL [SM02196] We can't use a stronger algorithm because we have to match the one which is currently used by SCSM's SQL engine
3030
byte[] hashBytes = sha1.ComputeHash(System.Text.Encoding.Unicode.GetBytes(s));
3131
byte[] bytesResult = Array.CreateInstance(typeof(byte), 16) as byte[];
3232
Array.Copy(hashBytes, 0, bytesResult, 0, 16);

0 commit comments

Comments
 (0)