MD5+盐加密
package com.mooc.house.common.utils;
import java.nio.charset.Charset;
import com.google.common.hash.HashCode;
import com.google.common.hash.HashFunction;
import com.google.common.hash.Hashing;
public class HashUtils {
private static final HashFunction FUNCTION = Hashing.md5();
private static final String SALT = "mooc.com";
public static String encryPassword(String password){
HashCode hashCode = FUNCTION.hashString(password+SALT, Charset.forName("UTF-8"));
return hashCode.toString();
}
}
==============================
QQ群:143522604
群里有相关资源
欢迎和大家一起学习、交流、提升!
==============================