This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

base64 encoding

is there any function or library that can encode data using base64 encoding..? in nrf51422

Parents Reply
  • When encoding to base64, the output size will increase by a factor of about 4/3. This is because every 3 bytes are encoded into 4 bytes, and finally padded to always be a multiple of 4 bytes. So the destination array needs to be larger. A more precise size than 4/3 is (src_length + 2 - ((src_length + 2) % 3)) / 3 * 4. You should then get that your string encodes into "ADUAAAAAAAAAADU=", which is reversed properly back to your start array.

Children
No Data
Related