Skip to content

Instantly share code, notes, and snippets.

@jdkane3
Created January 28, 2016 13:45
Show Gist options
  • Save jdkane3/fb19ebdcda726de7f448 to your computer and use it in GitHub Desktop.
Save jdkane3/fb19ebdcda726de7f448 to your computer and use it in GitHub Desktop.
Simple groovy example of encoding and decoding a string in Base 64
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