Steven Mark Ford
Steven Mark Ford

Reputation: 3432

Is the Android Util.Base64 default encoding behavior consistent

When encoding/decoding base64 data on Android using the Base64 Util (available as of Android SDK 8) one has the ability to specify Base64 flags to control specifics of the encoding e.g. Base64.NO_WRAP will prevent end of line characters.

My question is, is the Base64.DEFAULT flag behavior consistent from device to device, android version to android version etc. or is the default behavior unpredictable e.g. on some device might it implicitly do NO_WRAP etc.

Upvotes: 2

Views: 451

Answers (1)

CodePlay
CodePlay

Reputation: 2203

We are using Base64 to encrypt/decrypt the DESede/ECB cipher to string value and store to the database. The result is consistent in all devices we have tested so far, just that if you don't set the flag or set the flag to Base64.DEFAULT, it will generate next line or end of line characters in the result, but this result is same in every devices we have tested.

We specific Base64.NO_WRAP explicitly to make our result in a continuous string.

Upvotes: 2

Related Questions