Created
August 11, 2012 20:26
-
-
Save bdesham/3327022 to your computer and use it in GitHub Desktop.
Obfuscate text for use in web pages
This file contains 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
; Replaces each character with an HTML escape code like " ". | |
; This is useful as some lightweight protection against e-mail harvesting; | |
; it probably won't perform correctly with non-ASCII input. | |
; | |
; example: | |
; (obfuscate "example.com") | |
; => "example.com" | |
(defn obfuscate | |
[text] | |
(apply str (map #(format "&#x%x;" (int %)) | |
text))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment