当前位置:网站首页>String to Base64
String to Base64
2022-06-24 08:41:00 【Simon66991】
public class Base64Util {
private static final String UTF_8 = "UTF-8";
private static final String TAG = "Base64";
/** * To the given string base64 Decoding operation */
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;
}
/** * To the given string base64 Encryption operation */
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;
}
}
边栏推荐
- How to configure networkpolicy for nodeport in kubernetes
- ZUCC_ Principles of compiling language and compilation_ Experiment 02 fsharp Ocaml language
- Longhorn installation and use
- PHP代码加密的几种方案
- How to mount a USB hard disk with NTFS file format under RHEL5 system
- Fund raising, trading and registration
- [acnoi2022] not a structure, more like a structure
- Ordering of MySQL composite index
- ZUCC_编译语言原理与编译_实验06 07 语法分析 LL 分析
- Smart power plant: how to make use of easycvr to build a safe, stable, green and environment-friendly intelligent inspection platform
猜你喜欢

uniapp 热更新后台管理

ZUCC_编译语言原理与编译_实验04 语言与文法

MySQL 因字符集问题插入中文数据时提示代码 :1366

Qt 中发送自定义事件

ZUCC_ Principles of compiling language and compilation_ Experiment 02 fsharp Ocaml language

Markdown to realize text link jump

成为IEEE学生会员

表单图片上传在Chorme中无法查看请求体的二进制图片信息

A preliminary study of IO model

ZUCC_编译语言原理与编译_实验08 语法分析 LR 分析
随机推荐
Use cpulimit to free up your CPU
ZUCC_编译语言原理与编译_实验03 编译器入门
IIS build wordpress5.7 manually
Shell array
PHP代码加密的几种方案
RuntimeError: Missing dependencies:XXX
2021-03-09 comp9021 class 7 Notes
Using ngrok for intranet penetration
Common date formatter and QT method for obtaining current time
xtrabackup做数据备份
中国芯片独角兽公司
Introduction to NC machine tool programming [G-code]
解析互联网广告术语 CPM、CPC、CPA、CPS、CPL、CPR 是什么意思
Easycvr invokes the interface parameter acquisition method and precautions of device video recording on the page
【关于运维和网工的差别,一文说透】
Detailed explanation of etcd backup and recovery principle and actual record of stepping on the pit
ZUCC_编译语言原理与编译_实验05 正则表达式、有限自动机、词法分析
api平台通用签名机制
Using sonar for code checking
定时备份数据库脚本