From 4d6dc9aa1cb21f74c5bf4efca18ae71ce6af1415 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Thu, 6 Oct 2022 19:05:38 -0500 Subject: remove ToBase62String --- src/slskd/Common/CommonExtensions.cs | 21 --------------------- 1 file changed, 21 deletions(-) (limited to 'src') 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 @@ -324,27 +324,6 @@ namespace slskd return sanitized; } - /// - /// Converts the byte array into a base 62 encoded string. - /// - /// The bytes to convert. - /// The converted bytes as a base 62 string. - 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(); - } - /// /// Determines whether the given object is a . /// -- cgit v1.2.3