Created
September 17, 2017 08:12
-
-
Save tlrobinson/f5d4842fe488ba960b26fb9fc11c8d81 to your computer and use it in GitHub Desktop.
clojure base64 encode and decode for Java 8
This file contains 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
(defn- decode-base64 | |
[input] | |
(new java.lang.String (.decode (java.util.Base64/getDecoder) input) "utf-8")) | |
(defn- encode-base64 | |
[input] | |
(.encodeToString (java.util.Base64/getEncoder) (.getBytes input))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment