Results 1 to 20 of 20

Thread: VB - Fast Base64 Encoding and Decoding

Threaded View

  1. #18
    Frenzied Member
    Join Date
    May 2014
    Location
    Kallithea Attikis, Greece
    Posts
    1,309

    New Version Handle ANSI & Unicode Strings

    After some thoughts I found why earlier versions loose the last byte from an odd length byte ansi string.
    First problem was on Encoder, which use Len() and not LenB() to find the length of string. The second problem was on decoder, to feed the returned string with one byte more. The solution was to make a string as ansi, with the odd length and then copy the final bytes to that string.

    New to this version, except for handling odd length byte data:
    1. Compact the encoded string, means without Vbcrlf in each 60 output chars
    2. Added Left Margin, so we can insert in each line some space at the left
    3. Spaces and Cr/Lf can be anywhere in string to decode
    4. Abnormal character stop algorithm, or ACS. When a byte to decode is not in the normal character list to decode, stop the decoding returning decoding bytes at that point. There is a flag from decoder which turn to false if no decoding can be done (which means that ACS can't apply).
    5. There is a FileToEncode64() additional function to get any file as Encode64, without feeding a string before encoding

    George
    Attached Images Attached Images  
    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width