base64url in java

前端 未结 10 602
攒了一身酷
攒了一身酷 2020-12-05 06:49

https://web.archive.org/web/20110422225659/https://en.wikipedia.org/wiki/Base64#URL_applications

talks about base64Url - Decode


a modified Base64 for U

10条回答
  •  旧时难觅i
    2020-12-05 07:38

    In the Android SDK, there's a dedicated flag in the Base64 class: Base64.URL_SAFE, use it like so to decode to a String:

    import android.util.Base64;
    byte[] byteData = Base64.decode(body, Base64.URL_SAFE);
    str = new String(byteData, "UTF-8");
    

提交回复
热议问题