Created
February 2, 2014 18:59
-
-
Save langley/8773065 to your computer and use it in GitHub Desktop.
Base64 Encode/Decode using the org.apache.commons.codec included in Play2.2 from scala. This works in the "console" from the play app.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Works in the console from a Play 2.2 project | |
import org.apache.commons.codec.binary.Base64 | |
val encoded: Array[Byte] = Base64.encodeBase64("text to be encoded".getBytes) | |
val decoded: Array[Byte] = Base64.decodeBase64(encoded) | |
println(new String(decoded)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment