Groovy web console

subscribe to the feed Subscribe
to this
site

b64

Published 3 weeks ago by Anonymous
Actions  ➤ Edit in console Back to console Show/hide line numbers View recent scripts
def encoded = "Hello World".bytes.encodeBase64().toString()
println encoded
assert encoded == "SGVsbG8gV29ybGQ=" 
def decoded = new String("SGVsbG8gV29ybGQ=".decodeBase64())
println decoded
assert decoded == "Hello World"