Scrambles or descrambles a string according to the ROT13 standard.
Scrambles or descrambles a string according to the ROT13 standard.
Rate Scrambles or descrambles a string according to the ROT13 standard.
(1(1 Vote))
Public Function Rot13(ByVal j As String) As String
Dim c As Byte
Dim t As String
t = j
For i = 1 To Len(j)
t = Right(t, Len(j) - i + 1)
c = Asc(t)
If (c > 64) And (c < 78) Then
Rot13 = Rot13 + Chr(c + 13)
ElseIf (c > 77) And (c < 91) Then
Rot13 = Rot13 + Chr(c - 13)
ElseIf (c > 96) And (c < 110) Then
Rot13 = Rot13 + Chr(c + 13)
ElseIf (c > 109) And (c < 123) Then
Rot13 = Rot13 + Chr(c - 13)
Else
Rot13 = Rot13 + Chr(c)
End If
Next i
End Function
'Example, Rot13("Ruben") will return "Ehora"
'and Rot13("Ehora") will return "Ruben".
'Could be used to scramble contents of created
'text file etc. that you want to be accessed by
'your created program only.
'Created by "Ruben" <[email protected]>
Scrambles or descrambles a string according to the ROT13 standard. Comments
No comments yet — be the first to post one!
Post a Comment