السلام عليكم و رحمة الله و بركاته
Function encode_decode(ibuffer As String) As String
'function to decode or encode any size of string and return the code in string also
Dim tbuffer As String
t_buffer = ""
Dim code_value As Integer
Dim b_lenght As Integer
Dim i As String
code_value = 153 'set the code value
b_lenght = Len(ibuffer) 'get the lenght of the given string
Do While (b_lenght > 0)
i = Asc(Left(ibuffer, 1))
i = i Xor code_value
tbuffer = tbuffer + Chr(i) 'add the xo-ored value to the temp buffer
ibuffer = Right(ibuffer, (b_lenght - 1))
b_lenght = b_lenght - 1
Loop
encode_decode = tbuffer
End Function
أرجو تعليككم عليها .
والسلام