chore: add another method for base64 util

This commit is contained in:
2024-10-05 19:08:45 +08:00
parent 05efdaebff
commit 4078af7c29
1 file changed
+4
@@ -20,3 +20,7 @@ fun ByteArray.encodeToBase64(): String {
fun String.decodeToString(): String { fun String.decodeToString(): String {
return String(Base64.getDecoder().decode(this)) return String(Base64.getDecoder().decode(this))
} }
fun String.decodeToByteArray(): ByteArray {
return Base64.getDecoder().decode(this)
}