Private Sub Command1_Click()
Text2.Text = aaa(Text1.Text)
End Sub
Public Function aaa(b As String) As String
Dim li As Long
Dim li_pass As Long
Dim li_len As Long
Dim li1 As Long
Dim listart As Long '= 1
Dim lipos As Long '= 1
Dim lc As String
Dim ls1 As String
Dim lsrtn As String
Dim str As String
str = "AAAAAAAA"
ls_pass = b
listart = 1
lipos = 1
li_pass = Asc("8")
lsrtn = ""
ls_pass = Trim(ls_pass)
li_len = Len(ls_pass)
If li_len < 8 Then
ls_pass = Left(str, 8 - li_len) + ls_pass
'ls_pass = Space("A", 8 - li_len) + ls_pass
End If
ls_pass = Right(ls_pass, 8)
li = 1
li_len = 8
Do While li <= 4
lc = Mid(ls_pass, li_len, 1)
li1 = Asc(lc)
lsrtn = lsrtn + CStr(li1 Mod li_pass)
li_pass = li_pass + 8
lc = Mid(ls_pass, li, 1)
li1 = Asc(lc)
lsrtn = lsrtn + CStr(li1 Mod li_pass)
li_pass = li_pass - 11
li_len = li_len - 1
li = li + 1
Loop