-
-
Save bitsnaps/ddd71003b741a7f948f14cb76c25d4b5 to your computer and use it in GitHub Desktop.
Base64 encoding and decoding in Groovy.
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 text = "Going to convert this to Base64 encoding!" | |
// Encode | |
def encoded = text.bytes.encodeBase64().toString() | |
println encoded | |
// Decode | |
byte[] decoded = encoded.decodeBase64() | |
println new String(decoded) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment