Public Function HAZZ15_Encode(ByVal input As String) As String
input = Uri.EscapeDataString(input)
Dim key As String = "HNO4klm6ij9n+J2hyf0gzA8uvwDEq3X1Q7ZKeFrWcVTts/MRGYbdxSo=ILaUpPBC5"
Dim out As New System.Text.StringBuilder
Dim i As Integer
Do
Dim enc(3) As Integer
Dim chrs As Integer() = {0, 0, 0}
For b As Integer = 0 To 2
If i < input.Length Then chrs(b) = Asc(input(i))
i += 1
Next
enc(0) = chrs(0) >> 2
enc(1) = ((chrs(0) And 3) << 4) Or (chrs(1) >> 4)
enc(2) = ((chrs(1) And 15) << 2) Or (chrs(2) >> 6)
enc(3) = chrs(2) And 63
If chrs(1) = 0 Then
enc(2) = 64
enc(3) = 64
End If
If chrs(2) = 0 Then
enc(3) = 64
End If
For Each x As Integer In enc
out.Append(key(x))
Next
Loop While i < input.Length
Return out.ToString
End Function
Public Function HAZZ15_Decode(ByVal input As String) As String
Dim key As String = "HNO4klm6ij9n+J2hyf0gzA8uvwDEq3X1Q7ZKeFrWcVTts/MRGYbdxSo=ILaUpPBC5"
Dim out As New System.Text.StringBuilder
Dim i As Integer
Do
Dim enc(3) As Integer
Dim chrs() As Integer = {0, 0, 0}
For b As Integer = 0 To 3
enc(b) = key.IndexOf(input(i))
i = i + 1
Next
chrs(0) = (enc(0) << 2) Or (enc(1) >> 4)
chrs(1) = (enc(1) And 15) << 4 Or (enc(2) >> 2)
chrs(2) = (enc(2) And 3) << 6 Or enc(3)
out.Append(Chr(chrs(0)))
If enc(2) <> 64 Then out.Append(Chr(chrs(1)))
If enc(3) <> 64 Then out.Append(Chr(chrs(2)))
Loop While i < input.Length
Return out.ToString
End Function