(String strObj)
| 46 | } |
| 47 | |
| 48 | public static String GetMD5Code(String strObj) { |
| 49 | String resultString = null; |
| 50 | try { |
| 51 | resultString = new String(strObj); |
| 52 | MessageDigest md = MessageDigest.getInstance("MD5"); |
| 53 | // md.digest() �ú�������ֵΪ��Ź�ϣֵ�����byte���� |
| 54 | resultString = byteToString(md.digest(strObj.getBytes())); |
| 55 | } catch (NoSuchAlgorithmException ex) { |
| 56 | ex.printStackTrace(); |
| 57 | } |
| 58 | return resultString; |
| 59 | } |
| 60 | |
| 61 | public static void main(String[] args) { |
| 62 | CMD5 getMD5 = new CMD5(); |
no test coverage detected