字符串转换base64
2017-01-05 本文已影响0人
Victory_IT
1 先把字符串转换成byte数组
String phone ="0123abc";
byte[] bytes = phone.getBytes();
2 使用android自带的api把byte转换成base64的字符串
String s2 = Base64.encodeToString(bytes, Base64.DEFAULT);
Log.e("TAG","base64编码:"+ s2);