gllmflndn / gifti

MATLAB/Octave GIfTI Library
https://www.gllmflndn.com/software/matlab/gifti/
MIT License
25 stars 12 forks source link

Line breaks in Base64 strings #3

Open gllmflndn opened 5 years ago

gllmflndn commented 5 years ago

Sometimes Base64 strings contain line breaks (typically) every 76 characters: they should be ignored as well as any other character that is not in the Base64 character list. This is implemented in base64decode.m: https://github.com/gllmflndn/gifti/blob/master/%40gifti/private/base64decode.m#L36-L39 but not in base64.c. Fixing this will probably result in cancelling the speed advantage of the current C implementation with respect to other ones. Base64 encoding should not be modified to include line breaks.

See e.g.:

<Data>AhkAAANGAAACZAAABTcAAAJkAAADRgAAAmQAAAU3AACDEQAAA0YAAEIGAAAFNwAAgxEAAANkAAAC
ZAAABGQAAAJkAAADZAAAAmQAAARkAAACGQAAA2QAAMUNAAAEZAAAYwQAAAJGAACILwAABGQAAIgv
AAACRgAA
</Data>