Java MD5加密

public String getPwd(String pwd){
        String newPwd=null;
        try {
            MessageDigest md5=MessageDigest.getInstance("MD5");
            BASE64Encoder base64en = new BASE64Encoder();
            newPwd=base64en.encode(md5.digest(pwd.getBytes("utf-8")));
        } catch (NoSuchAlgorithmException e) {
            e.printStackTrace();
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        }
        return newPwd;
    }


你可能感兴趣的:(java,return,null,MD5加密)