Last active
February 19, 2025 11:58
-
-
Save rotaliator/a1a7b8b56ba17896dfc6567e7e97f291 to your computer and use it in GitHub Desktop.
base64 encode clojure
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
(import '(java.util Base64)) | |
(defn b64encode-to-bytes [to-encode] | |
(.encode (Base64/getEncoder) (.getBytes to-encode))) | |
(defn b64encode [to-encode] | |
(.encodeToString (Base64/getEncoder) (.getBytes to-encode))) | |
(defn b64decode [to-decode] | |
(String. (.decode (Base64/getDecoder) (.getBytes to-decode)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment