Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Encode/Decode Text String

Status
Not open for further replies.

TheAceMan1

Programmer
Sep 23, 2003
11,174
US
Howdy Everyone . . . . .

Looking for a routine to [blue]Encode/Decode[/blue] a variable length text string . . . . .

Any Ideas?

Calvin.gif
See Ya! . . . . . .
 
What type of encoding/decoding do you want to use? Or do you mean encryption?

Good Luck
--------------
To get the most from your Tek-Tips experience, please read FAQ181-2886
As a circle of light increases so does the circumference of darkness around it. - Albert Einstein
 
If you want HTMl encoding, then try this:

Function URLEncode(Data)
Dim I, C, Out
For I = 1 To Len(Data)
C = Asc(Mid(Data, I, 1))
If C = 32 Then
Out = Out + "+"
ElseIf C < 48 Then
Out = Out + "%" + Hex(C)
Else
Out = Out + Mid(Data, I, 1)
End If
Next
URLEncode = Out
End Function
 
How are ya CajunCenturion . . . .

I should've said encryption, but it really does'nt matter. I require certain text unreadable to the user and need to decrypt to get the actual string. Of course this has to do with security.

Calvin.gif
See Ya! . . . . . .
 
I sometimes take a peek at what's happening in the VB5/6 forum, and here's a thread (thread222-535644) where strongm demonstrates one technique (some more should be available there by keyword search)

Roy-Vidar
 
For encryption, I've had no problems with the CryptoAPI, and the technique by strongm in the thread referenced in RoyVidar's post is as good as it gets.

Good Luck
--------------
To get the most from your Tek-Tips experience, please read FAQ181-2886
As a circle of light increases so does the circumference of darkness around it. - Albert Einstein
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top