MD5加密

    public static String getStringResult(String str){
        String rel="";
        try {
            MessageDigest md=MessageDigest.getInstance("MD5");
            md.update(str.getBytes());
            rel=new BigInteger(1,md.digest()).toString();
        } catch (Exception e) {
            // TODO: handle exception
            System.out.println("MD5加密错误");
        }
        return rel;
    }

你可能感兴趣的:(MD5加密)