当前位置:网站首页>速查表之转MD5
速查表之转MD5
2022-07-28 05:22:00 【Alex_z0897】
生成md5并输出16进制,统一java,python,dart之间的md5校验
java-spring
System.out.println(org.springframework.util.DigestUtils.md5DigestAsHex("asdf".getBytes()));
public abstract class DigestUtils {
//略...无关代码
private static final char[] HEX_CHARS = new char[]{'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};
//生成md5 encode 为16进制,简称hex
private static char[] encodeHex(byte[] bytes) {
char[] chars = new char[32];
for(int i = 0; i < chars.length; i += 2) {
byte b = bytes[i / 2];
chars[i] = HEX_CHARS[b >>> 4 & 15]; //0xf0 = 15
chars[i + 1] = HEX_CHARS[b & 15];
}
return chars;
}
}
python
import hashlib
print hashlib.md5("asdf").hexdigest()
dart
import 'dart:convert';
import "package:crypto/crypto.dart";
var md = md5.convert(utf8.encode('asdf'));
print(md.toString());
边栏推荐
- 连续登陆问题
- Notice of attack: [bean Bingbing] send, sell, cash, draw, prize, etc
- 微信小程序开发详细步骤是什么?
- 【六】redis缓存策略
- Books - investment ideas and Strategies
- 数据处理之增删改;约束
- 区分实时数据、离线数据、流式数据以及批量数据的区别
- 3:Mysql 主从复制搭建
- 1: Why should databases be divided into databases and tables
- Sales notice: on July 22, the "great heat" will be sold, and the [traditional national wind 24 solar terms] will be sold in summer.
猜你喜欢
随机推荐
使用pyhon封装一个定时发送邮件的工具类
Continuous login problem
微信小程序手机号正则校验规则
排序与分页,多表查询课后练习
ModuleNotFoundError: No module named ‘pip‘
MySQL练习题50道+答案
CertPathValidatorException:validity check failed
Regular verification rules of wechat applet mobile number
Kotlin语言现在怎么不火了?你怎么看?
On how digital collections and entities can empower each other
微服务架构认知、服务治理-Eureka
项目不报错,正常运行,无法请求到服务
50 MySQL exercises + Answers
Redis 主从架构的搭建
【7】 Consistency between redis cache and database data
【五】redis主从同步与Redis Sentinel(哨兵)
The combination of cultural tourism and digital collections has a significant effect, but how to support users' continuous purchasing power
疫情当下,线下文旅受困,看数字藏品能否解围?
ModuleNotFoundError: No module named ‘pip‘
Chapter IX sub query (key)









