new line appending on my encrypted string

前端 未结 6 1544
长发绾君心
长发绾君心 2020-12-08 03:54

In Main:

public static void main(String[] args) throws NoSuchAlgorithmException {
    System.out.println(\"encrypt:\" + encryptPassword(\"superuser\")+\":\"          


        
6条回答
  •  既然无缘
    2020-12-08 04:22

    You just need to Use Base64 encoding in following way

    Base64.encodeBase64String("Your data to encrypt in base64", Base64.DEFAULT)
    

    Change above line with the followings

    Base64.encodeBase64String("Your data to encrypt in base64",Base64.NO_WRAP)
    

    It worked for me.

提交回复
热议问题