News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

base 32

Started by Mango Here, March 16, 2012, 11:19:28 AM

Previous topic - Next topic

Mango Here

I am just searching for base32 encoding and decoding example. I googled a lot but not found anything even in entire forum.

Anyone can help me out?

FORTRANS

Hi,

   Welcome to the forum.

   Why do you want Base32 encoding and decoding?  Anyway
you can look for Base64 or Base85 code and adapt that to your
needs.  The problem with Base32 is it uses 5 bits to encode a
symbol.  Five does not divide into a multiple of eight easily, so
there is extra work to keep track of the bits.  (Eight bits assumes
you want to encode bytes of course.)  Base64 with six bits is
a bit easier to keep track of for instance.

   The basic way to do this would be shift and mask the five bit
Base32 code from a "string" or "stream" of bits.  That would
allow you encode the data (use the five bit value to index a
symbol table).  To decode you convert the Base32 code to
binary and shift the current bit stream five bits and add the
binary value to the stream.  You could look for LZW code
which can do this, though coding it yourself should be fairly
straight forward.

Cheers,

Steve N.

dedndave

easy enough - you need to select a code-set, is all
http://en.wikipedia.org/wiki/Base32

a while back, i wrote 64-bit encode/decode routines with checksum - used to hash INI file values
here it is in INC form...

Mango Here

thank you :bg i will look over it