| 基于J2ME的MD5算法类 |
 |
作者: 来源: 日期:2007-4-17 11:10:17 点击次数: |
|
{ abyte0[k] = (byte)(int)(al[j] & 255L); abyte0[k + 1] = (byte)(int)(al[j] >>> 8 & 255L); abyte0[k + 2] = (byte)(int)(al[j] >>> 16 & 255L); abyte0[k + 3] = (byte)(int)(al[j] >>> 24 & 255L); j++; } } private void Decode(long al[], byte abyte0[], int i) { int j = 0; for(int k = 0; k < i; k += 4) { al[j] = b2iu(abyte0[k]) | b2iu(abyte0[k + 1]) << 8 | b2iu(abyte0[k + 2]) << 16 | b2iu(abyte0[k + 3]) << 24; j++; } } public static long b2iu(byte byte0) { return byte0 >= 0 ? byte0 : byte0 & 0xff; } public static String byteHEX(byte byte0) {//字节到十六进制的ASCII码转换 char ac[] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' }; char ac1[] = new char[2]; ac1[0] = ac[byte0 >>> 4 & 0xf]; ac1[1] = ac[byte0 & 0xf]; String s = new String(ac1); return s; } public static String toMD5(String s) { MD5 md5 = new MD5(); return md5.getMD5ofStr(s); } }
本新闻共 6页,当前在第 6页 1 2 3 4 5 6 上一篇:目前市面各种加密狗原理介绍 下一篇:bmp format(bmp文件格式) |
|
|
 |
| 北京总部: 4006-505-808 |
| 上 海 部: 021-58358765 |
| 深 圳 部: 0755-83692929 |
| 浙 江 部: 13666673722 |
| 广 州 部: 020-83821091 |
| 重 庆 部: 023-86870422 |
| 昆 明 部: 15987117834 |
| 哈尔滨部: 13946167430 |
| 其它地区: 4006-505-808 | | | |
|
 |
|