PC Review


Reply
Thread Tools Rate Thread

Decode function in vb.net

 
 
Valli
Guest
Posts: n/a
 
      22nd Jan 2010
Hi,

I am having encode & decode functions in C.
Will get an encoded value in vb.net & this must be decoded using vb.net code.
How can I apply this?

The decode function in C is

/*Decode function to decode the incoming buffer containing encoded data*/
void decode(char *inbuf,int sizeInbuffer,char *outbuf,int *decodeoutbufsize)
{
/*Local Declaration*/
unsigned char in[4], out[3], v;
int i, len,j;
int counter=0;
int a1=0;

for(j=0;j<sizeInbuffer;j=j+4)
{
for( len = 0, i = 0; i < 4; i++ )
{
v = 0;
while(v==0)
{
v=(unsigned char) inbuf[counter++];
v = (unsigned char) ((v < 43 || v > 122) ? 0 : cd64[ v - 43 ]);
if( v )
{
v = (unsigned char) ((v == '$') ? 0 : v - 61);
}
}
len++;
if( v )
{
in[ i ] = (unsigned char) (v - 1);
}
}

if( len )
{
decodeblock( in, out );
memcpy(outbuf+a1,out,3);
// printf("%d",strlen(outbuf));
a1+=3;
}
}

*decodeoutbufsize = a1; //Done at SetDecodedLengthForOrderMsg(). Subtract by 2 since we have only 439 bytes, Last 1 byte also decoded with more than one byte(i.e, two bytes).
return;
}



--
Regards
Valli
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Decode function gg.2.max-75@spamgourmet.com Microsoft Access Reports 3 28th Sep 2009 04:34 PM
Decode MP3 to PCM? matt@fortissoftware.com Microsoft C# .NET 0 16th Aug 2006 10:53 PM
How to decode? Murgi Freeware 5 17th May 2004 03:28 PM
decode =?Utf-8?B?a2FsbA==?= Windows XP Video 1 15th Feb 2004 09:51 PM
url en/decode steve Microsoft VB .NET 10 6th Feb 2004 11:51 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:36 PM.