byte array into chunks with 6bits each • Map the 6 bits into 1 character ( fi ll 0 for missing bits) • Create new chunks with 4 characters each ( fi ll = for missing characters) • Concatenate the chunks into single string
encoded string to a fi le with android.util.Base64 with DEFAULT fl ag • Then read the fi le to decode kotlin.io.encoding.Base64.Default 📱 📱 android.util.Base64 kotlin.io.encoding.Base64 send TW9iaWxlIERldiBKYXBhbg== “Mobile Dev Japan” ?
separates lines with 76 characters each, adds line separators including last line • kotlin.io.encoding.Base64.Default will reject the line separators 📱 📱 android.util.Base64 kotlin.io.encoding.Base64 send TW9iaWxlIERldiBKYXBhbg== “Mobile Dev Japan” 💥 “Mobile Dev Japan”
other way around • kotlin.io.encoding.Base64.Default will not add line separators • android.util.Base64 doesn’t care if it contains more than 76 characters in the single line, as it ignores line separator 📱 📱 kotlin.io.encoding.Base64 android.util.Base64 send TW9iaWxlIERldiBKYXBhbg== “Mobile Dev Japan” “Mobile Dev Japan”
ags (NO_WRAP, CRLF) when encoding • This doesn’t guarantee that output from android.util.Base64 satisfy other RFCs that java.util.Base64 or kotlin.io.encoding.Base64 follow