+ Reply to Thread
Results 1 to 2 of 2

Encode/Decode a byte array to/from Base64 format

  1. #1
    Registered User
    Join Date
    05-26-2014
    Posts
    6

    Encode/Decode a byte array to/from Base64 format

    Hi
    I am trying to make an encode/decode function to use in excel from base64 to array of bytes
    I want to put string encoded in base64 in cell1 and get result in cell2 with decoded array of bytes and vice versa
    i find some codes
    http://www.nonhostile.com/howto-enco...base64-vb6.asp
    and a code here
    https://stackoverflow.com/questions/...sing-excel-vba

    using the code above to convert A1
    A1 = a03060fa564665
    ENCODEBASE64(A1) -> YTAzMDYwZmE1NjQ2NjU= (which is correct result for string "a03060fa564665" not the array of bytes)
    while correct result i need is oDBg+lZGZQ==

    i know the issue is converting string to array of bytes but i couldn't fix it myself

    example
    if cell1= a03060fa564665
    result1= oDBg+lZGZQ==
    if cell2= oDBgm1BGaQ==
    result2= a030609b504669

    any help please
    thanks in advance
    Last edited by jeff_123; 05-29-2014 at 07:42 AM.

  2. #2
    Registered User
    Join Date
    05-26-2014
    Posts
    6

    Re: Encode/Decode a byte array to/from Base64 format

    i find one code to encode and decode base64

    Please Login or Register  to view this content.
    and i managed to make the function to decode base64 to give me array of bytes

    Please Login or Register  to view this content.

    now if cell2 = oDBgm1BGaQ==
    i get result2= A030609B504669

    but now am facing problem writing the reverse function to convert array of bytes to base64 string
    if cell1= a03060fa564665
    result1= oDBg+lZGZQ==
    any idea please

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Convert Byte array to Base64 Binary
    By ganesh961991 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-15-2014, 07:47 AM
  2. Converting a string to a utf8 byte array
    By technoyogi in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-14-2011, 05:06 AM
  3. Convert two-byte numbers to one-byte?
    By cheaperThanAPro in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-25-2007, 07:12 PM
  4. Passing Byte array to DLL
    By Tom in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-04-2006, 11:30 AM
  5. [SOLVED] how to format double byte data
    By 67SBSQSB in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-02-2006, 01:55 AM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1