diff options
| author | JP Dillingham <jpdillingham@gmail.com> | 2021-06-14 20:03:36 -0500 |
|---|---|---|
| committer | JP Dillingham <jpdillingham@gmail.com> | 2021-06-14 20:03:36 -0500 |
| commit | 050be311e68bb316cfc40fbd23bfd5a812e1a060 (patch) | |
| tree | 1476cba9e90845f224bbc0a380e4633697e1306e /src/slskd/Common/Compute.cs | |
| parent | 4cf8f8fa862b08131e9cc51c4bad3d6c9838342b (diff) | |
| download | slskd-050be311e68bb316cfc40fbd23bfd5a812e1a060.tar.gz | |
move stuff around
Diffstat (limited to 'src/slskd/Common/Compute.cs')
| -rw-r--r-- | src/slskd/Common/Compute.cs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/slskd/Common/Compute.cs b/src/slskd/Common/Compute.cs index 172de252..3d913d27 100644 --- a/src/slskd/Common/Compute.cs +++ b/src/slskd/Common/Compute.cs @@ -18,6 +18,8 @@ namespace slskd { using System; + using System.Security.Cryptography; + using System.Text; /// <summary> /// Computational functions. @@ -35,5 +37,11 @@ namespace slskd return (clampedDelay, jitter); } + + public static string Sha1Hash(string str) + { + using var sha1 = new SHA1Managed(); + return BitConverter.ToString(sha1.ComputeHash(Encoding.UTF8.GetBytes(str))).Replace("-", string.Empty); + } } }
\ No newline at end of file |
