RosettaCodeData/Task/Base64-decode-data/Scala/base64-decode-data.scala
2023-07-01 13:44:08 -04:00

14 lines
385 B
Scala

import java.util.Base64
object Base64Decode extends App {
def text2BinaryDecoding(encoded: String): String = {
val decoded = Base64.getDecoder.decode(encoded)
new String(decoded, "UTF-8")
}
def data =
"VG8gZXJyIGlzIGh1bWFuLCBidXQgdG8gcmVhbGx5IGZvdWwgdGhpbmdzIHVwIHlvdSBuZWVkIGEgY29tcHV0ZXIuCiAgICAtLSBQYXVsIFIuIEVocmxpY2g="
println(text2BinaryDecoding(data))
}