MD5WLBUtil
import java.io.UnsupportedEncodingException;
import java.security.NoSuchAlgorithmException;
import java.security.MessageDigest; public class MD5WLBUtil
{
public static byte[] md54wlb(final byte[] binaryData) throws NoSuchAlgorithmException, UnsupportedEncodingException {
final MessageDigest md = MessageDigest.getInstance("MD5");
md.update(binaryData);
final byte[] b = md.digest();
final StringBuffer buf = new StringBuffer("");
for (int offset = 0; offset < b.length; ++offset) {
int i = b[offset];
if (i < 0) {
i += 256;
}
if (i < 16) {
buf.append("0");
}
buf.append(Integer.toHexString(i));
}
return buf.toString().getBytes();
}
}
MD5WLBUtil的更多相关文章
随机推荐
- 【LeetCode】060. Permutation Sequence
题目: The set [1,2,3,…,n] contains a total of n! unique permutations. By listing and labeling all of t ...
- [转]django 日志logging的配置以及处理
http://davidbj.blog.51cto.com/4159484/1433741 日志在程序开发中是少不了的,通过日志我们可以分析到错误在什么地方,有什么异常.在生产环境下有很大的用途.在J ...
- URL、SRC、HREF知识整理
今天理一下URL.SRC.HREF定义以及使用区别. URL(Uniform Resource Locator) 统一资源定位符是对可以从互联网上得到的资源的位置和访问方法的一种简洁的表示,是互联网上 ...
- HDUj2612(两个起点找到最近的目的地)
Find a way Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total ...
- 微服务理论之六:ESB与SOA的关系
一.SOA和ESB一直是没有明确概念的两个缩略词 SOA----面向服务架构,实际上强调的是软件的一种架构,一种支撑软件运行的相对稳定的结构,表面含义如此,其实SOA是一种通过服务整合来解决系统集成的 ...
- uva 512
1. 问题 不知道怎么存储操作 看代码注释,else if等 2. 代码 #include <iostream> #include <stdio.h> #include < ...
- 想要table表格垂直滚动,加点CSS即可
<style> /*设置 tbody高度大于400px时 出现滚动条*/ table tbody { display: block; height: 400px; overflow-y: ...
- Tiny4412学习杂记
1.Android 挂载NFS 使用 busybox mount 来替代mount命令 2.修改Uboot中fastboot最大buff 使用U-boot烧写Android5.0的时候出现 remo ...
- 《精通Spring4.X企业应用开发实战》读后感第六章(容器事件)
- Struts2学习第七课 ActionSupport
com.opensymphony.xwork2.ActionSupport类是默认的Action类,如果某个Action节点没有配置class属性,则ActionSupport即为待执行的Action ...