Skip to content

Instantly share code, notes, and snippets.

@tlrobinson
Created September 17, 2017 08:12
Show Gist options
  • Save tlrobinson/f5d4842fe488ba960b26fb9fc11c8d81 to your computer and use it in GitHub Desktop.
Save tlrobinson/f5d4842fe488ba960b26fb9fc11c8d81 to your computer and use it in GitHub Desktop.
clojure base64 encode and decode for Java 8
(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