Base64 decode data: Difference between revisions

Content deleted Content added
Scala contribution added.
Line 576: Line 576:
--Paul R.Ehrlich
--Paul R.Ehrlich
</pre>
</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}}==
=={{header|Seed7}}==
Line 598: Line 615:


{{out}}
{{out}}
<pre>Is the Rosetta Code icon the same (byte for byte) encoded then decoded: TRUE</pre>
<pre>
Is the Rosetta Code icon the same (byte for byte) encoded then decoded: TRUE
</pre>


=={{header|Sidef}}==
=={{header|Sidef}}==