MD5加密

try {
        MessageDigest messageDigest = MessageDigest.getInstance("md5");
        byte[] bytes = messageDigest.digest(str.getBytes("utf-8"));
        BigInteger bigInteger = new BigInteger(1, bytes);
        String md5 = bigInteger.toString(16);
        return md5;
    } catch (NoSuchAlgorithmException e) {
        e.printStackTrace();
    } catch (UnsupportedEncodingException e) {
        e.printStackTrace();
    }
    return null;
}
展开阅读全文

没有更多推荐了,返回首页