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
Possible duplicate of Clojure equivalent of python's base64 encode and decode
The Tupelo library has Clojure wrappers around the base Java Base64 and Base64Url functionality. A look at the unit tests show the code in action:
(ns tst.tupelo.base64
(:require [tupelo.base64 :as b64] ))
code-str (b64/encode-str orig)
result (b64/decode-str code-str) ]
(is (= orig result))
where the input & output values are plain strings (there is also a variant for byte arrays).
The API docs are here.