Attribute VB_Name = "modVL64" Public Function VL64Encode(Data As String) As String On Error Resume Next If Data - 3 > 0 Then For i = 0 To 3 If ((Data - i) Mod 4) = 0 Then cod1 = Chr(i + 80) cod2 = Chr((Data - i) / 4 + 64) End If Next i VL64Encode = cod1 & cod2 Else VL64Encode = Chr(Data + 72) End If End Function Public Function VL64Decode(Data As String) As String On Error Resume Next Dim Second As String nf = (Asc(Left(Data, 1)) - 72) / 4 If nf < 1 Then nf = 0 End If If (nf Mod 2) = 0 Then nf = nf / 2 For i = 1 To nf R = R + ((Asc(Mid(Data, i + 1, 1)) - 64) * (64 ^ (i - 1))) Next i id = (4 * R) + ((Asc(Left(Data, 1)) - 72) Mod 4) Else RawID = Left(Data, 2) Second = Replace(RawID, "S", "", 1, 1) id = (Asc(Second) - 64) * 4 + nf End If VL64Decode = id End Function