Skip to content

Instantly share code, notes, and snippets.

@brake
Created April 19, 2017 14:35
Show Gist options
  • Select an option

  • Save brake/53945f226416be0b1220315938af7ea3 to your computer and use it in GitHub Desktop.

Select an option

Save brake/53945f226416be0b1220315938af7ea3 to your computer and use it in GitHub Desktop.
ASCII to Hex String in Clojure
(defn ascii->hex-string
"Perform Hex Encoding of a string: String(208A) -> String(32303841)"
[s]
(->> s
(map #(Integer/toHexString (int %)))
(apply str)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment