Anonymous user
Base64 decode data: Difference between revisions
Scala contribution added.
(Scala contribution added.) |
|||
Line 576:
--Paul R.Ehrlich
</pre>
=={{header|Scala}}==
{{Out}}Best seen in running your browser either by [https://scalafiddle.io/sf/mjgxJDp/0 ScalaFiddle (ES aka JavaScript, non JVM)] or [https://scastie.scala-lang.org/P4RfGhRQSkaKWEmdBi1gaw Scastie (remote JVM)].
<lang 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))
}</lang>
=={{header|Seed7}}==
Line 598 ⟶ 615:
{{out}}
<pre>Is the Rosetta Code icon the same (byte for byte) encoded then decoded: TRUE</pre>▼
▲Is the Rosetta Code icon the same (byte for byte) encoded then decoded: TRUE
=={{header|Sidef}}==
|