• Welcome to Valhalla Legends Archive.
 

Decoding Base64

Started by Fr0z3N, June 07, 2003, 01:41 PM

Previous topic - Next topic

Fr0z3N

Can anyone give me an easy script to decode Base64? I also never learned how to deocde hex.  :-*

VisualBasic6

Yoni

www.pscode.com has lots of stuff

(You never specified language)

UserLoser

So many non bot development related posts in this forum......

Fr0z3N

I thought this would go here since I am putting this in a bot.

Banana fanna fo fanna

its not hex
second you havent heard of pscode.com?

Fr0z3N

I do but most of the time I can't find what I'm looking for, in this case, Base64.

Banana fanna fo fanna


Fr0z3N

Google is the worst VisualBasic 6 search engin.

dxoigmn

Quote from: Fr0z3N on June 12, 2003, 06:37 AM
Google is the worst VisualBasic 6 search engin.

Perhaps you should learn to search properly?  I've found atleast 10 examples of how to do Base 64 encoding/decoding (in Visual Basic) on PlanetSourceCode alone.  As for google, I'm sure I could find many more examples floating around.

Zakath

Incidentally, I seem to remember Adron creating a library specificly for dealing with encryption and decryption in several formats. It's hosted on this web site, as I recall. You didn't even need to leave the domain to find stuff that could help you.
Quote from: iago on February 02, 2005, 03:07 PM
Yes, you can't have everybody...contributing to the main source repository.  That would be stupid and create chaos.

Opensource projects...would be dumb.

Adron

Quote from: Zakath on June 16, 2003, 05:52 PM
Incidentally, I seem to remember Adron creating a library specificly for dealing with encryption and decryption in several formats. It's hosted on this web site, as I recall. You didn't even need to leave the domain to find stuff that could help you.

Yes, that can decode base64, but if the only thing he wants is to decode base64, it's overkill to try to use the library.

c0ol

#11
whats the big deal? this is a simple numeric base conversion, its less programming, more math.  You shoud try something like this (i know no VB):

#include <math.h>
char encoded[256];
int character_offset = 48, places = 2, base = 64;

for (;*string;string++) {
   char ch = string[0];
   for(i = places-1;i >= 0;i--) {
       int x = pow(base, i);
       if (ch > x)
           int a = ch / x;  // i think putting this in int context removes the decimal
           ch -= a * x;
           encoded++ = a + characterset_offset;
       }else {
           encoded++ = characterset_offset;
       }
   }
}      // note i didnt really test this, i just kinda made it up but i think it captures the idea.

Banana fanna fo fanna

Quote
~~ The stupidity of others prevents me from doing my task ~~

Nice sig, btw.

Arta

Yes, i just noticed that fun little irony too  ::)