Do most of the proto and database groundwork for the new mediaName.

This commit is contained in:
Greyson Parrelli
2025-06-20 11:47:54 -04:00
committed by Cody Henthorne
parent e705495638
commit 38c8f852bf
431 changed files with 600 additions and 781 deletions

View File

@@ -130,4 +130,24 @@ object Base64 {
private fun String.stripPadding(): String {
return this.replace("=", "")
}
fun String.decodeBase64OrThrow(): ByteArray {
return try {
decode(this)
} catch (e: IOException) {
throw AssertionError("Invalid Base64 string: $this", e)
}
}
fun String?.decodeBase64(): ByteArray? {
if (this == null) {
return null
}
return try {
decode(this)
} catch (e: IOException) {
return null
}
}
}