@@ -0,0 +1,1186 @@
+package edu.ptu.test.messageDigest;%0A%0Aimport org.junit.Test;%0A%0Aimport java.security.MessageDigest;%0Aimport java.security.NoSuchAlgorithmException;%0A%0A/**%0A * Created by WangAnshu on 2016/6/6.%0A */%0Apublic class MessageDigestTest %7B%0A    @Test%0A    public void test()%7B%0A        try %7B%0A            MessageDigest md5 = MessageDigest.getInstance(%22MD5%22);%0A            byte%5B%5D bytes = %22%E6%9D%A5%E2%80%B2%22.getBytes();%0A            System.out.println(%22===%3E%22+bytes.length);%0A            md5.update(bytes);%0A            byte%5B%5D digest = md5.digest();%0A            System.out.println(%22===%3E result %22+digest.length);//128%E4%BD%8Dbit%EF%BC%8C 16%E4%B8%AA%E5%AD%97%E8%8A%82%EF%BC%8C32%E4%B8%AA16%E8%BF%9B%E5%88%B6%E5%AD%97%E7%AC%A6%0A            System.out.println(%22===%3E result %22+new String(digest));%0A            int i;%0A%0A            StringBuffer buf = new StringBuffer(%22%22);%0A            for (int offset = 0; offset %3C bytes.length; offset++) %7B%0A                i = bytes%5Boffset%5D;%0A                if (i %3C 0)%0A                    i += 256;%0A                if (i %3C 16)%0A                    buf.append(%220%22);%0A                buf.append(Integer.toHexString(i));%0A            %7D%0A            System.out.println(%22===%3E str %22+buf.toString());%0A        %7D catch (NoSuchAlgorithmException e) %7B%0A            e.printStackTrace();%0A        %7D%0A%0A%0A    %7D%0A%7D%0A

test messageDisgest:测试md5