1.2.0 permalink Arrow_down_16x16
  • (encode-str s)
  • (encode-str s encoding line-length)
Encodes String in base 64; returns a String. If not specified,
encoding is UTF-8 and line-length is nil.

0 Examples top

Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source clojure/contrib/base64.clj:79 top

(defn encode-str
  "Encodes String in base 64; returns a String.  If not specified,
  encoding is UTF-8 and line-length is nil."
  ([s] (encode-str s "UTF-8" nil))
  ([^String s ^String encoding line-length]
     (let [output (StringWriter.)]
       (encode (ByteArrayInputStream. (.getBytes s encoding))
               output *base64-alphabet* line-length)
       (.toString output))))
Vars in clojure.contrib.base64/encode-str: defn let
Used in 0 other vars

Comments top

No comments for encode-str. Log in to add a comment.