当前位置:网站首页>String转Base64
String转Base64
2022-06-24 07:02:00 【Simon66991】
public class Base64Util {
private static final String UTF_8 = "UTF-8";
private static final String TAG = "Base64";
/** * 对给定的字符串进行base64解码操作 */
public static String decodeData(String inputData) {
try {
if (null == inputData) {
return null;
}
return new String(Base64.decodeBase64(inputData.getBytes(UTF_8)), UTF_8);
} catch (UnsupportedEncodingException e) {
Log.d(TAG, "encodeData: ", e);
}
return null;
}
/** * 对给定的字符串进行base64加密操作 */
public static String encodeData(String inputData) {
try {
if (null == inputData) {
return null;
}
return new String(Base64.encodeBase64(inputData.getBytes(UTF_8)), UTF_8);
} catch (UnsupportedEncodingException e) {
Log.d(TAG, "encodeData: ", e);
}
return null;
}
}
边栏推荐
- 13 -- remove invalid parentheses
- ZUCC_ Principles of compiling language and compilation_ Experiment 02 fsharp Ocaml language
- App Startup
- 【力扣10天SQL入门】Day2
- 问题3 — messageBox弹框,修改默认背景色
- Getting started with ffmpeg
- 贷款五级分类
- leetcode 1268. Search Suggestions System(搜索推荐系统)
- pyQt 中 QMenu 响应
- How to implement approval function in Tekton
猜你喜欢

Permission model DAC ACL RBAC ABAC

【无标题】
![[micro services ~nacos] Nacos service providers and service consumers](/img/b7/47ecd6979ccfeb270261681d6130be.png)
[micro services ~nacos] Nacos service providers and service consumers

Markdown to realize text link jump

List of Li Bai's 20 most classic poems

5 minutes, excellent customer service chat handling skills

成为IEEE学生会员

问题3 — messageBox弹框,修改默认背景色

Question 4 - datepicker date selector, disabling two date selectors (start and end dates)

Longhorn installation and use
随机推荐
2021-03-04 comp9021 class 6 notes
成为IEEE学生会员
487. number of maximum consecutive 1 II ●●
中国芯片独角兽公司
13 -- 移除无效的括号
【力扣10天SQL入门】Day2
将mysql的数据库导出xxx.sql,将xxx.sql文件导入到服务器的mysql中。项目部署。
小样本故障诊断 - 注意力机制代码 - BiGRU代码解析实现
Three categories of financial assets under the new standards: AMC, fvoci and FVTPL
Which is the first poem of Tang Dynasty?
Promise usage scenarios
SQL intra statement operation
QPS, TPS, concurrent users, throughput relationship
复习SGI STL二级空间配置器(内存池) | 笔记自用
(PKCS1) RSA 公私钥 pem 文件解析
(pkcs1) RSA public private key PEM file parsing
PAT 1157:校庆
貸款五級分類
IIS build wordpress5.7 manually
MAYA重新拓布