06.HighQualityMethodsHomework/RefactorCSharpPart2Exam/11. CSharp-Part-2-Exam/CSharp-Part-2-Exam/EnigmaCat/EnigmaCat.cs
/// <summary>
/// Converts an unsigned 64-bit-integer to base 26 numeric system
/// </summary>
/// <param name="decimalNumber">Number to convert as an unsigned 64-bit-integer</param>
/// <returns>Number in base 26 numeric system as string</returns>
Converts an unsigned 64-bit-integer to base 26 numeric system
Converts an unsigned 64 - bit - integer to base 26 numeric system
private static string ConvertToBase26(ulong decimalNumber)
        {
            StringBuilder converedNumberToBase26AsStringBuilder = new StringBuilder();
            ulong decimalNumberCopy = decimalNumber;
            if (decimalNumberCopy == 0)
            {
                return "a";
            }
            while (decimalNumberCopy != 0)
            {
                converedNumberToBase26AsStringBuilder.Append((char)((decimalNumberCopy % 26) + 'a'));
                decimalNumberCopy /= 26;
            }
            string result = string.Join(string.Empty, converedNumberToBase26AsStringBuilder.ToString().Reverse()).Trim();
            return result;
        }
private static string ConvertToBase26 ( ulong decimalNumber ) { StringBuilder converedNumberToBase26AsStringBuilder = new StringBuilder ( ) ; ulong decimalNumberCopy = decimalNumber ; if ( decimalNumberCopy == 0 ) { return " " ; } while ( decimalNumberCopy != 0 ) { converedNumberToBase26AsStringBuilder . Append ( ( char ) ( ( decimalNumberCopy % 26 ) + ' ' ) ) ; decimalNumberCopy /= 26 ; } string result = string . Join ( string . Empty , converedNumberToBase26AsStringBuilder . ToString ( ) . Reverse ( ) ) . Trim ( ) ; return result ; }
Converts an unsigned 64-bit-integer to base 26 numeric system
Converts an unsigned 64 - bit - integer to base 26 numeric system
// Check if number is first digit in base 26 // Convert to a numeric system using the standard formula for conversion
Number in base 26 numeric system as string
Number in base 26 numeric system as string
decimalNumber
ulong
Number to convert as an unsigned 64-bit-integer
Number to convert as an unsigned 64 - bit - integer