You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
NacosRefreshHistory 直接采用 BigInteger 的 toString(16) 方法来计算 MD5,是否有计算结果长度不足32位数的风险?
NacosRefreshHistory uses BigInteger's toString(16) method to calculate md5. Is there a risk that the calculated result will be less than 32 digits long?
Which Component
Nacos 配置中心
Nacos(spring-cloud-starter-alibaba-nacos-config)
版本: 2023.x
version: 2023.x
Describe what problem you have encountered
直接采用 BigInteger#toString(16) 计算 md5
NacosRefreshHistory uses BigInteger's toString(16) method to calculate md5.
// com.alibaba.cloud.nacos.refresh.NacosRefreshHistory#md5privateStringmd5(Stringdata) {
if (StringUtils.isEmpty(data)) {
returnnull;
}
if (null == md) {
try {
md = MessageDigest.getInstance("MD5");
}
catch (NoSuchAlgorithmExceptionignored) {
return"unable to get md5";
}
}
// toString(16) ?returnnewBigInteger(1, md.digest(data.getBytes(StandardCharsets.UTF_8)))
.toString(16);
}
Describe what information you have read
直接阅读源码发现的。
I have read the source code of Nacos(spring-cloud-starter-alibaba-nacos-config).
The text was updated successfully, but these errors were encountered:
This issue has been automatically marked as stale because it hasn't had any recent activity.If you think this should still be open, or the problem still persists, just pop a reply in the comments and one of the maintainers will (try!) to follow up. Thank you for your interest and contribution to the Sping Cloud Alibaba Community.
NacosRefreshHistory 直接采用 BigInteger 的 toString(16) 方法来计算 MD5,是否有计算结果长度不足32位数的风险?
NacosRefreshHistory uses BigInteger's toString(16) method to calculate md5. Is there a risk that the calculated result will be less than 32 digits long?
Which Component
Nacos 配置中心
Nacos(spring-cloud-starter-alibaba-nacos-config)
版本: 2023.x
version: 2023.x
Describe what problem you have encountered
直接采用 BigInteger#toString(16) 计算 md5
NacosRefreshHistory uses BigInteger's toString(16) method to calculate md5.
Describe what information you have read
直接阅读源码发现的。
I have read the source code of Nacos(spring-cloud-starter-alibaba-nacos-config).
The text was updated successfully, but these errors were encountered: