diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/slskd/Common/Compute.cs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/slskd/Common/Compute.cs b/src/slskd/Common/Compute.cs index b9dc882a..befceb88 100644 --- a/src/slskd/Common/Compute.cs +++ b/src/slskd/Common/Compute.cs @@ -20,7 +20,6 @@ namespace slskd using System; using System.Security.Cryptography; using System.Text; - using System.Text.RegularExpressions; /// <summary> /// Computational functions. @@ -44,5 +43,11 @@ namespace slskd using var sha1 = SHA1.Create(); return BitConverter.ToString(sha1.ComputeHash(Encoding.UTF8.GetBytes(str))).Replace("-", string.Empty); } + + public static string Sha256Hash(string str) + { + using var sha256 = SHA256.Create(); + return BitConverter.ToString(sha256.ComputeHash(Encoding.UTF8.GetBytes(str))).Replace("-", string.Empty); + } } }
\ No newline at end of file |
