当前位置:网站首页>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;
}
}
边栏推荐
- JUC个人简单笔记
- How to configure networkpolicy for nodeport in kubernetes
- New technology practice, encapsulating the permission application library step by step with the activity results API
- ZUCC_ Principles of compiling language and compilation_ Big job
- Robot acceleration level task priority inverse kinematics
- Small sample fault diagnosis - attention mechanism code - Implementation of bigru code parsing
- Final review and key points of software process and project management
- After interviewing and tutoring several children, I found some problems!
- ZUCC_编译语言原理与编译_实验01 语言分析与简介
- 新准则金融资产三分类:AMC、FVOCI和FVTPL
猜你喜欢

12-- merge two ordered linked lists

ZUCC_ Principles of compiling language and compilation_ Experiment 08 parsing LR parsing

Introduction to RCNN, fast RCNN and fast RCNN

2022年制冷与空调设备运行操作上岗证题库及模拟考试

How to improve the customer retention rate in the operation of independent stations? Customer segmentation is very important!

Qt导出PDF文件的两种方法

一文带你了解Windows操作系统安全,保护自己的电脑不受侵害

【关于运维和网工的差别,一文说透】

日本大阪大学万伟伟研究员介绍基于WRS系统机器人的快速集成方法和应用

JUC个人简单笔记
随机推荐
Markdown 实现文内链接跳转
中国芯片独角兽公司
[micro services ~nacos] Nacos service providers and service consumers
Which is the first poem of Tang Dynasty?
RCNN、Fast-RCNN、Faster-RCNN介绍
2022年制冷与空调设备运行操作上岗证题库及模拟考试
Live broadcast review | detailed explanation of koordinator architecture of cloud native hybrid system (complete ppt attached)
Chart list Performance Optimization: minimum resource consumption in the visualization area
ZUCC_编译语言原理与编译_实验02 FSharp OCaml语言
LabVIEW finds prime numbers in an array of n elements
2021-06-25: a batch of strings consisting only of lowercase letters (a~z) are put
权限模型 DAC ACL RBAC ABAC
Qmenu response in pyqt
Qt导出PDF文件的两种方法
ZUCC_编译语言原理与编译_实验03 编译器入门
[xinliu-s6 new model +sa 3-star Xinghai] the new two-way server of the third generation chip was launched and the product was updated~
12--合并两个有序链表
Take my brother to do the project. It's cold
js中通过key查找和更新对象中指定值的方法
2021-03-16 comp9021 class 9 notes