Good day ladies and gentlemen. Yesterday I came across a really nasty piece of code and had to rewrite it in a different language (VBScript > C#) and still acheive the same result. I had a great deal of fun doing it and I am pretty certain you will too! I thought I would start with a relatively small challenge to gauge the interest. If the interest is big then we can look at doing team challenges or collaborative challenges which I figure might be quiet nice for figuring out how other people think and solve problems.
Ok here is the deal.
The problem:Given the string (GUID/UUID):
8cdb240881e34b8c9ba2916c14927946
Convert it to the following string:
LPQOFHDLLERGHOLPMONFMEJPEHMFKMHJ
The original function looked like this:
Dim x, y, abfrom, abto
Encode = "" : abfrom = ""
For x = 0 To 25 : abfrom = abfrom & Chr(65 + x) : Next
For x = 0 To 25 : abfrom = abfrom & Chr(97 + x) : Next
For x = 0 To 9 : abfrom = abfrom & CStr(x) : Next
abto = Mid(abfrom, 14, Len(abfrom)  13) & Left(abfrom, 13)
For x = 1 To Len(sIn) : y = InStr(abfrom, Mid(sIn, x, 1))
If y = 0 Then
Encode = Encode & Mid(sIn, x, 1)
Else
Encode = Encode & Mid(abto, y, 1)
End If
Next

 Dim x, y, abfrom, abto
 Encode = "" : abfrom = ""

 For x = 0 To 25 : abfrom = abfrom & Chr(65 + x) : Next
 For x = 0 To 25 : abfrom = abfrom & Chr(97 + x) : Next
 For x = 0 To 9 : abfrom = abfrom & CStr(x) : Next

 abto = Mid(abfrom, 14, Len(abfrom)  13) & Left(abfrom, 13)
 For x = 1 To Len(sIn) : y = InStr(abfrom, Mid(sIn, x, 1))
 If y = 0 Then
 Encode = Encode & Mid(sIn, x, 1)
 Else
 Encode = Encode & Mid(abto, y, 1)
 End If
 Next

Your challenge:Rewrite this in any other language (I had to do it in C# and it took me about 30/45 minutes).
Submission Format & RulesSince this could probably be wrapped up in a single method/function, post your solutions in this topic. Once someone has posted a solution in a specific language you may not repost the same algorithim in that language. If it is a variation on the algorithm it is fine
In closingIt isn't that hard but it is cool when you get it right! Happy hunting and this challenge finishes end Aug 2009 or when everyone is bored with it