/*    */ package com.picc.grab.util;
/*    */ 
/*    */ import java.io.UnsupportedEncodingException;
/*    */ import java.security.MessageDigest;
/*    */ import java.security.NoSuchAlgorithmException;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ public class MD5Util
/*    */ {
/*    */   public static String md5Hex32(String str) {
/* 16 */     StringBuffer hexString = new StringBuffer();
/* 17 */     if (str != null && str.trim().length() != 0) {
/*    */       try {
/* 19 */         MessageDigest md = MessageDigest.getInstance("MD5");
/*    */         try {
/* 21 */           md.update(str.getBytes("UTF-8"));
/* 22 */         } catch (UnsupportedEncodingException e) {
/* 23 */           e.printStackTrace();
/*    */         } 
/* 25 */         byte[] hash = md.digest();
/* 26 */         for (int i = 0; i < hash.length; i++) {
/* 27 */           if ((0xFF & hash[i]) < 16) {
/* 28 */             hexString.append("0" + Integer.toHexString(0xFF & hash[i]));
/*    */           } else {
/* 30 */             hexString.append(Integer.toHexString(0xFF & hash[i]));
/*    */           } 
/*    */         } 
/* 33 */       } catch (NoSuchAlgorithmException e) {
/* 34 */         System.err.println(e.getMessage());
/* 35 */         return "";
/*    */       } 
/*    */     }
/*    */     
/* 39 */     return hexString.toString().toUpperCase();
/*    */   }
/*    */ }


/* Location:              C:\Users\Administrator\Desktop\ROOT\WEB-INF\classes\!\com\picc\gra\\util\MD5Util.class
 * Java compiler version: 8 (52.0)
 * JD-Core Version:       1.1.3
 */