Created
January 7, 2017 07:52
-
-
Save sebastibe/1aa0d8aabb317246b62090c8a7f5d226 to your computer and use it in GitHub Desktop.
Format IEEE 802 MAC Address in 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
(defn split-string [s factor] | |
(->> (partition-all factor s) | |
(map (partial apply str)))) | |
(defn format-mac [value] | |
(apply str (map clojure.string/upper-case (interpose ":" (split-string value 2))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment