惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

美团技术团队
B
Blog RSS Feed
博客园_首页
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Google DeepMind News
Google DeepMind News
D
Docker
Blog — PlanetScale
Blog — PlanetScale
M
MIT News - Artificial intelligence
C
Check Point Blog
The Cloudflare Blog
T
Tailwind CSS Blog
大猫的无限游戏
大猫的无限游戏
量子位
The GitHub Blog
The GitHub Blog
Microsoft Azure Blog
Microsoft Azure Blog
I
InfoQ
T
The Blog of Author Tim Ferriss
博客园 - 【当耐特】
Vercel News
Vercel News
P
Proofpoint News Feed
Hugging Face - Blog
Hugging Face - Blog
V
V2EX
博客园 - 司徒正美

博客园 - 筱老邪

2026年读书清单,及java技术的巩固 请求处理 图片转为为流的处理 SHA1签名算法,JAVA和C# C#与Java互通AES算法加密解密 在Java和C#中计算SHA-1哈希 .net5读取xml文件 部署linux 踩坑 多线程 .net知识点 下载文件,204问题 debug和release的web.config分开配置 数据库的索引查找 sql 查询出符合条件的表增加字段 HTTP状态码:400\500 错误代码 - 筱老邪 - 博客园 linq 两个list交集差集处理 rabbitMQ的使用 rabbitMQ的部署安装 sql 游标循环
编码和解码
筱老邪 · 2025-05-19 · via 博客园 - 筱老邪
public static String toBase64String(String value) throws UnsupportedEncodingException {
if (value == null || value.isEmpty()) {
return "";
}
byte[] bytes = value.getBytes(StandardCharsets.UTF_8);
return java.net.URLEncoder.encode(new String(Base64.getEncoder().encode(bytes)), "UTF-8");
}

public static String UnBase64String(String value) throws UnsupportedEncodingException {
if (value == null || value.isEmpty()) {
return "";
}
String decodeValue= java.net.URLDecoder.decode(value, "UTF-8");
byte[] decodedBytes = Base64.getDecoder().decode(decodeValue);
return new String(decodedBytes,StandardCharsets.UTF_8);
}