new line appending on my encrypted string

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

In Main:

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


        
6条回答
  •  萌比男神i
    2020-12-08 04:22

    In case anyone needs this for any libraries using OkHttp, there's a Credentials class you can use for Base64 encoding your username/pass

    String credentials = Credentials.basic("username", "password");
    
    request.header(HttpHeaders.AUTHORIZATION, credentials);
    

提交回复
热议问题