For c# fans
This assumes the "z69JZ..." above uses an alpha "O" instead of a numeric "0".
Converted from the posted code snippet earlier. (Thanks)
class Program
{
static void Main(string[] args)
{
Test();
}
static string alph = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
static void Test()
{
string s = "z69JZqlJn862D1ndx7oLVEMmVOlP1zewEeUCrsI7Roahzpeny7P";
string p = "6EQUJ5";
int i = 0;
while (i < s.Length)
{
int n = idxof(s[i], alph);
int v = idxof(p[i % p.Length], alph);
v = (v + n) % 62;
Console.Write(alph[v]);
i++;
}
Console.WriteLine();
Console.WriteLine("Press any key");
Console.ReadKey();
}
static int idxof(char c, string alphabet){
for (int i = 0; i < alphabet.Length; i++)
if (alphabet[i] == c){ return i; }
return -1;
}
}