alpha0010 / react-native-file-access

Filesystem access for React Native
MIT License
307 stars 19 forks source link

Change Android Base64 mode to omit line breaks #26

Closed menssen closed 3 years ago

menssen commented 3 years ago

This is mostly a suggestion: the DEFAULT options of Base64.encodeString() adds line breaks to wrap the output to 80 (or something like that) characters. The iOS base64 encoder does not do this, making the Android and iOS output of readFile(..., 'base64') different. I believe this change would make them the same. (Additionally, a lot of base64 decoders, reasonably or not, do not seem to correctly handle the line breaks. I had to strip them out manually to use as input for pdf-lib, e.g..

alpha0010 commented 3 years ago

Thank you.