javaµÄMD5¼ÓÃÜÓë½âÃÜ
·½·¨Ò»£ºÖ»¼ÓÃÜ
import java.security.*;
import java.security.spec.*;
class MD5_test {
public final static String MD5(String s) {
char hexDigits[] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
'a', 'b', 'c', 'd', 'e', 'f' };
try {
byte[] strTemp = s.getBytes();
MessageDigest mdTemp = MessageDigest.getInstance("MD5");
mdTemp.update(strTemp);
byte[] md = mdTemp.digest();
int j = md.length;
char str[] = new char[j * 2];
int k = 0;
for (int i = 0; i < j; i++) {
byte byte0 = md[i];
str[k++] = hexDigits[byte0 >>> 4 & 0xf];
str[k++] = hexDigits[byte0 & 0xf];
}
return new String(str);
} catch (Exception e) {
return null;
}
}
public static void main(String[] args) {
// MD5_Test aa = new MD5_Test();
System.out.print(MD5_test.MD5("b"));
}
}
·½·¨¶þ£º¼ÓÃÜÓë½âÃÜ
import java.security.MessageDigest;
public class MD5andKL {
// MD5¼ÓÂë¡£32λ
public static String MD5(String inStr) {
MessageDigest md5 = null;
try {
md5 = MessageDigest.getInstance("MD5");
} catch (Exception e) {
System.out.println(e.toString());
e.printStackTrace();
 
Ïà¹ØÎĵµ£º
System.currentTimeMillis()£º¿ÉÒÔÌáÈ¡µ½µ±Ç°Ê±¼äµÄºÁÃëÊý£¬²úÉúÒ»¸öµ±Ç°µÄºÁÃ룬Õâ¸öºÁÃëÆäʵ¾ÍÊÇ×Ô1970Äê1ÔÂ1ÈÕ0ʱÆðµÄºÁÃëÊý¡£
³£¼û×÷ÓãºÒ»°ã¶¼ÊÇÓÃ2¸öʱ¼äµÄ²îÖµÀ´µÃµ½ÔËÐÐʱ¼äµÄ£¬³£ÓÃÀ´±È½Ï2¸öËã·¨µÄЧÂÊ£¡
long start = System.currentTimeMillis();
// ÕâÀï¿ÉÒÔ¼ÓÉÏÄãÒªÖªµÀµÄ·½·¨ÔËÐеÄʱ¼ä£¡£¡
......
LinuxÅäÖÃjava¿ª·¢Æ½Ì¨
Ò»¡¢°²×°jdk
1.ÏÂÔØ°²×°jdk
£¨1£©¡¢Ê×ÏÈ£¬ÔÚhttp://java.sun.com
ÕÒµ½ÒªÏÂÔصÄjdk£¬ÏÂÔØ×Ô¼ºÐèÒªµÄjdk°æ±¾¡£ÎÒÕâÀïʹÓõÄÊÇjdk6£¬µÃµ½µÄÊÇÒ»¸öÃûΪjdk-6u6-linux-i586-rpm.binµÄÎļþ¡£´ËÎļþµ±Ç°Îª²»¿ÉÔËÐеÄshell script¡£
£¨2£©¡¢¸ü¸ÄȨÏÞ£¬ÌáÈ¡jdk°²×°Îļþ£º
´ò¿ªÖÕ¶ËÔËÐ ......
½øÒ»·¨£º ¼´Ê¡ÂÔµÄλÉÏÖ»Òª´óÓÚÁ㶼Ҫ½øһλ £»
ËÄÉáÎåÈë·¨£º ¼´Ê¡ÂÔµÄλÉÏСÓÚÎ嶼ҪÉáÈ¥£¬µ«Ê¡ÂÔµÄλÉÏÂúÎ嶼Ҫ½øһλ £»
»¹ÓÐÒ»ÖÖ
ȥβ·¨£º ¼´Ê¡ÂÔµÄλÉϲ»¹ÜÊÇ·ñÂúÎ嶼ҪÉáÈ¥ £»
1¡¢³ý·¨´øСÊý
ÀýÈ磺
int a = 8;
int b = 3;
int c = ((double)la)/b;
System.out.println(c); ......
1.ÄãÐèÒª¾«Í¨ÃæÏò¶ÔÏó·ÖÎöÓëÉè¼Æ(OOA/OOD)¡¢É漰ģʽ(GOF£¬J2EEDP)ÒÔ¼°×ÛºÏģʽ¡£ÄãÓ¦¸ÃÊ®·ÖÁ˽âUML£¬ÓÈÆäÊÇclass£¬object£¬interactionÒÔ¼°statediagrams¡£
¡¡¡¡2.ÄãÐèҪѧϰJAVAÓïÑԵĻù´¡ÖªÊ¶ÒÔ¼°ËüµÄºËÐÄÀà¿â
(collections£¬serialization£¬streams£¬networking£¬
multithreading£¬reflection£¬event£¬h ......