diff options
| author | JP Dillingham <jp@dillingham.me> | 2022-06-28 10:36:12 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-06-28 10:36:12 -0500 |
| commit | 77df3572c381150dc60454be03ca3176a940a628 (patch) | |
| tree | bd28e93414bc580fac30619a994756ad1193d99b /src/slskd/Common/Compute.cs | |
| parent | 18e5c8dd9a98862422a46221f99a1091a9314381 (diff) | |
| parent | 1d211e640b8677753be7fee06f640f43863f8e68 (diff) | |
| download | slskd-77df3572c381150dc60454be03ca3176a940a628.tar.gz | |
Merge pull request #534 from slskd/send-stats
Include upload slot and approximate queue position with search results
Diffstat (limited to 'src/slskd/Common/Compute.cs')
| -rw-r--r-- | src/slskd/Common/Compute.cs | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/src/slskd/Common/Compute.cs b/src/slskd/Common/Compute.cs index eacaedf1..b9dc882a 100644 --- a/src/slskd/Common/Compute.cs +++ b/src/slskd/Common/Compute.cs @@ -44,22 +44,5 @@ namespace slskd using var sha1 = SHA1.Create(); return BitConverter.ToString(sha1.ComputeHash(Encoding.UTF8.GetBytes(str))).Replace("-", string.Empty); } - - public static string MaskHash(string str) - { - var hash = Sha1Hash(str); - hash = Convert.ToBase64String(Encoding.UTF8.GetBytes(hash)); - hash = Regex.Replace(hash, @"[\d=]", string.Empty).ToLowerInvariant(); - - // in some very unlucky circumstances, the sha1 might end up being all or mostly numbers. - // if this is the case the resulting hash could be fewer than the 5 characters we need, - // so copy it until we get to 5 - while (hash.Length < 5) - { - hash += hash; - } - - return $"@@{hash.Substring(0, 5)}"; - } } }
\ No newline at end of file |
