private static Int64 GetNumericalEquivalent(String Block) { var size = Letters.Count(); Int64 result = 0; for (int i = Block.Count() - 1; i >= 0; --i) { var character = Block[Block.Count() - i - 1]; result += Math.Pow(size, i) * Letters[character]; } return(result); }
private static String GetStringEquivalent(Int64 Number, Int32 Blocksize) { var size = Letters.Count(); String result = ""; for (int i = Blocksize - 1; i >= 0; --i) { var power = Math.Pow(size, i); var res = Number / power; result += ReversedLetters[res]; Number -= (res * power); } return(result); }