I want something as simple as \"string\" -> base64. With the older base64.encode-str it was easy (and sounded \"more clojure\", but the newer clojure.data.codec.base64
clojure.data.codec.base64
There's one more step needed for the other answer: converting the byte-array result of encode into a string. Here's what I do:
encode
(:require [clojure.data.codec.base64 :as b64]) (defn string-to-base64-string [original] (String. (b64/encode (.getBytes original)) "UTF-8"))