- 博客(0)
- 资源 (10)
- 收藏
- 关注
MD5加密解密的例子
private static final String HEX_NUMS_STR="0123456789ABCDEF";
private static final Integer SALT_LENGTH = 12;
/**
* 将16进制字符串转换成字节数组
* @param hex
* @return
*/
public static byte[] hexStringToByte(String hex) {
int len = (hex.length() / 2);
byte[] result = new byte[len];
char[] hexChars = hex.toCharArray();
for (int i = 0; i < len; i++) {
int pos = i * 2;
result[i] = (byte) (HEX_NUMS_STR.indexOf(hexChars[pos]) << 4
| HEX_NUMS_STR.indexOf(hexChars[pos + 1]));
}
return result;
}
.......................
.........................
.........................
2011-01-25
SCJP试题 中英文对照
SCJP试题 中英文对照
Which of the following range of short is correct?
A. -27 -- 27-1 B. 0 – 216-1 C. 215 – 215-1 D. 231 – 231-1 翻译:下面哪些是short型的取值范围。
答案::C
解析:短整型的数据类型的长度是16 bits,有符号。另外需要说明的是java中所有的整(Integral)数(包括byte,short,int,long)全是有符号的。
2008-09-29
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人