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);
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);