public static String md5(String message) {
try {
MessageDigest md = MessageDigest.getInstance("md5");
byte[] md5 = md.digest(message.getBytes());
BASE64Encoder encode = new BASE64Encoder();
return encode.encode(md5);
} catch (NoSuchAlgorithmException e) {
throw new RuntimeException(e);
}
}