pull/466/head
gedoor 4 years ago
parent 768bb8bdc3
commit 55aedfecee
  1. 2
      app/src/main/java/io/legado/app/utils/EncoderUtils.kt

@ -25,6 +25,7 @@ object EncoderUtils {
return tmp.toString() return tmp.toString()
} }
@JvmOverloads
fun base64Decode(str: String, flags: Int = Base64.DEFAULT): String { fun base64Decode(str: String, flags: Int = Base64.DEFAULT): String {
val bytes = Base64.decode(str, flags) val bytes = Base64.decode(str, flags)
return try { return try {
@ -34,6 +35,7 @@ object EncoderUtils {
} }
} }
@JvmOverloads
fun base64Encode(str: String, flags: Int = Base64.NO_WRAP): String? { fun base64Encode(str: String, flags: Int = Base64.NO_WRAP): String? {
return Base64.encodeToString(str.toByteArray(), flags) return Base64.encodeToString(str.toByteArray(), flags)
} }

Loading…
Cancel
Save