WANG %!s(int64=6) %!d(string=hai) anos
pai
achega
cf7caa2376
Modificáronse 1 ficheiros con 33 adicións e 0 borrados
  1. 33 0
      src/main/java/cn/com/qmth/examcloud/commons/util/MD5.java

+ 33 - 0
src/main/java/cn/com/qmth/examcloud/commons/util/MD5.java

@@ -0,0 +1,33 @@
+package cn.com.qmth.examcloud.commons.util;
+
+import org.apache.commons.codec.digest.DigestUtils;
+
+/**
+ * 类注释
+ *
+ * @author WANGWEI
+ */
+public class MD5 {
+
+	/**
+	 * 方法注释
+	 *
+	 * @author WANGWEI
+	 * @param str
+	 * @return
+	 */
+	public static String encrypt32(String str) {
+		return DigestUtils.md5Hex(str);
+	}
+
+	/**
+	 * 方法注释
+	 *
+	 * @author WANGWEI
+	 * @param str
+	 * @return
+	 */
+	public static String encrypt16(String str) {
+		return DigestUtils.md5Hex(str).substring(8, 24);
+	}
+}