Created
January 28, 2016 13:45
-
-
Save jdkane3/fb19ebdcda726de7f448 to your computer and use it in GitHub Desktop.
Simple groovy example of encoding and decoding a string in Base 64
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
def s = 'Argh, Groovy you say, mate?' | |
def b64 = s.bytes.encodeBase64().toString() | |
def bytes = b64.decodeBase64() | |
def decodedData = new String(bytes) | |
println s | |
println b64 | |
println decodedData |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment