@Test public void encodeMd5StrAndBase64() throws Exception { String origin = "a12345678"; String result = Coder.encodeMd5StrAndBase64(origin); logger.info("encodeMd5StrAndBase64, origin: [{}], result: [{}]", origin, result); }
public static String encodeMd5StrAndBase64(String origin) { String result = ""; try { MessageDigest md; md = MessageDigest.getInstance(KEY_MD5); md.update(origin.getBytes()); result = encodeBASE64(encryptHex(md.digest()).getBytes()); } catch (Exception e) { logger.error("Exception:-> [{}]", e); } return result; }
Coder { public static String encodeMd5StrAndBase64(String origin) { String result = ""; try { MessageDigest md; md = MessageDigest.getInstance(KEY_MD5); md.update(origin.getBytes()); result = encodeBASE64(encryptHex(md.digest()).getBytes()); } catch (Exception e) { logger.error("Exception:-> [{}]", e); } return result; } }
Coder { public static String encodeMd5StrAndBase64(String origin) { String result = ""; try { MessageDigest md; md = MessageDigest.getInstance(KEY_MD5); md.update(origin.getBytes()); result = encodeBASE64(encryptHex(md.digest()).getBytes()); } catch (Exception e) { logger.error("Exception:-> [{}]", e); } return result; } private  Coder(); }
Coder { public static String encodeMd5StrAndBase64(String origin) { String result = ""; try { MessageDigest md; md = MessageDigest.getInstance(KEY_MD5); md.update(origin.getBytes()); result = encodeBASE64(encryptHex(md.digest()).getBytes()); } catch (Exception e) { logger.error("Exception:-> [{}]", e); } return result; } private  Coder(); static String checkMd5(String originStr); static String checkMd5(byte[] msg); static String encryptPassWithSlat(String passwordMd5, String key); static String decryptPsWithSlat(String desPassword, String key); static boolean manyMd5PasswordCompare(String originPassword, String predictPassword, int loop); static String encryptHex(byte[] b); static byte[] decryptHex(String s); static String encodeBASE64(byte[] key); static byte[] decodeBASE64(String key); static String encodeMd5StrAndBase64(String origin); static String encodeMd5ByteAndBase64(String origin); static String encodeSHA1(String data); static String encodeSHA1ByDigestUtils(String data); static String encodeSHA256(String data); static String encodeSHA256ByDigestUtils(String data); static String initMacKey(); static byte[] encryptHMAC(byte[] data, String key); static String encryptHmacSha256(String data, String key); static String unicodeToCn(String unicode); static String cnToUnicode(String cn); }
Coder { public static String encodeMd5StrAndBase64(String origin) { String result = ""; try { MessageDigest md; md = MessageDigest.getInstance(KEY_MD5); md.update(origin.getBytes()); result = encodeBASE64(encryptHex(md.digest()).getBytes()); } catch (Exception e) { logger.error("Exception:-> [{}]", e); } return result; } private  Coder(); static String checkMd5(String originStr); static String checkMd5(byte[] msg); static String encryptPassWithSlat(String passwordMd5, String key); static String decryptPsWithSlat(String desPassword, String key); static boolean manyMd5PasswordCompare(String originPassword, String predictPassword, int loop); static String encryptHex(byte[] b); static byte[] decryptHex(String s); static String encodeBASE64(byte[] key); static byte[] decodeBASE64(String key); static String encodeMd5StrAndBase64(String origin); static String encodeMd5ByteAndBase64(String origin); static String encodeSHA1(String data); static String encodeSHA1ByDigestUtils(String data); static String encodeSHA256(String data); static String encodeSHA256ByDigestUtils(String data); static String initMacKey(); static byte[] encryptHMAC(byte[] data, String key); static String encryptHmacSha256(String data, String key); static String unicodeToCn(String unicode); static String cnToUnicode(String cn);  }