Hex-string-encode-and-decode - WeOnlyDo Software example code



All

wodCrypt (12)
wodSSH (10)
wodSFTP (23)
wodSSHServer (1)
wodSSHTunnel (11)
wodSSHpackage
wodSFTPdll

wodSSH.NET (10)
wodSFTP.NET (24)
wodFtpDLX.NET (22)
wodWebServer.NET (10)

wodAppUpdate (13)
wodHttpDLX (8)
wodFtpDLX (22)
wodTelnetDLX
wodFTPServer (3)
wodWebServer (10)
wodVPN
wodXMPP (13)
All ** [Visual Basic] ** [C#] ** [VB.NET] **

Hex string encode and decode
VB code
Dim inBlob As MemBlob
Set inBlob = New MemBlob

'Add some data for Hex encoding.
inBlob.Text = "this is some test string"

Dim encData As String
'Encode data to Hex.
encData = inBlob.ToHex
Debug.Print encData

Dim outBlob As MemBlob
Set outBlob = New MemBlob

'Decode Hex data previously encoded in this example.
outBlob.FromHex (encData)
Debug.Print outBlob.Text
VB.NET code
Dim inBlob As WODCRYPTCOMLib.MemBlob
inBlob = New WODCRYPTCOMLib.MemBlob

'Add some data for Hex encoding.
inBlob.Text = "this is some test string"

Dim encData As String
'Encode data to Hex.
encData = inBlob.ToHex
Console.WriteLine(encData)

Dim outBlob As WODCRYPTCOMLib.MemBlob
outBlob = New WODCRYPTCOMLib.MemBlob

'Decode Hex data previously encoded in this example.
outBlob.FromHex(encData)
Console.WriteLine(outBlob.Text)
C# code
WODCRYPTCOMLib.MemBlob inBlob;
inBlob = new WODCRYPTCOMLib.MemBlob();

//Add some data for Hex encoding.
inBlob.Text = "this is some test string";

string encData;
//Encode data to Hex.
encData = inBlob.ToHex();
Console.WriteLine(encData);

WODCRYPTCOMLib.MemBlob outBlob;
outBlob = new WODCRYPTCOMLib.MemBlob();

//Decode Hex data previously encoded in this example.
outBlob.FromHex(encData);
Console.WriteLine(outBlob.Text);