diff options
| author | JP Dillingham <jp@dillingham.me> | 2022-10-06 19:05:38 -0500 |
|---|---|---|
| committer | JP Dillingham <jp@dillingham.me> | 2022-10-06 19:05:38 -0500 |
| commit | 4d6dc9aa1cb21f74c5bf4efca18ae71ce6af1415 (patch) | |
| tree | 67af167bcaa0a4ec8bb55fd1c18150d939aafc72 /src/slskd/Common/CommonExtensions.cs | |
| parent | 47cdbc6ad812cdbec12ae50a046ea04c39faf5ec (diff) | |
| download | slskd-4d6dc9aa1cb21f74c5bf4efca18ae71ce6af1415.tar.gz | |
remove ToBase62String
Diffstat (limited to 'src/slskd/Common/CommonExtensions.cs')
| -rw-r--r-- | src/slskd/Common/CommonExtensions.cs | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/src/slskd/Common/CommonExtensions.cs b/src/slskd/Common/CommonExtensions.cs index 0998d44d..307e1469 100644 --- a/src/slskd/Common/CommonExtensions.cs +++ b/src/slskd/Common/CommonExtensions.cs @@ -325,27 +325,6 @@ namespace slskd } /// <summary> - /// Converts the byte array into a base 62 encoded string. - /// </summary> - /// <param name="bytes">The bytes to convert.</param> - /// <returns>The converted bytes as a base 62 string.</returns> - public static string ToBase62String(this byte[] bytes) - { - const string alphabet = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; - - BigInteger dividend = new BigInteger(bytes); - var builder = new StringBuilder(); - - while (dividend != 0) - { - dividend = BigInteger.DivRem(dividend, alphabet.Length, out BigInteger remainder); - builder.Insert(0, alphabet[Math.Abs((int)remainder)]); - } - - return builder.ToString(); - } - - /// <summary> /// Determines whether the given object is a <see cref="Dictionary{TKey, TValue}"/>. /// </summary> /// <param name="obj">The object to check.</param> |
