Base64 encoder and decoder

后端 未结 5 1698
感动是毒
感动是毒 2020-11-27 04:40

Is there a base-64 decoder and encoder for a String in Android?

5条回答
  •  有刺的猬
    2020-11-27 05:22

    If you don't want a line break at the end of the String, change the flags from Base64.DEFAULT to Base64.NO_WRAP

    Base64.encodeToString("yourString".getBytes("UTF-8"), Base64.NO_WRAP);
    

提交回复
热议问题