I actually like the original lower/upper/digit the best:

lower (seq "abcdefghijklmnopqrstuvwxyz")
upper (seq "ABCDEFGHIJKLMNOPQRSTUVWXYZ")
digit (seq "0123456789")

It's just immediately obvious, especially for instance if you wanted to 
remove ambiguous chars like 0, O, l, I.


On Wednesday, June 12, 2013 7:30:31 PM UTC-5, Shannon Severance wrote:
>
> Thank you all, I've learned something from each entry. My latest version, 
> incorporating some of the changes suggested:
>
> (defn make-crypto []
>   (let [lower (map char (range (int \a) (inc (int \z))))
>         upper (map char (range (int \A) (inc (int \Z))))
>         digit (map char (range (int \0) (inc (int \9))))
>         
>         [sl su sd] (map shuffle [lower upper digit])
>         
>         encrypt (zipmap (concat lower upper digit) 
>                         (concat sl su sd))]
>     (fn [s]
>       (apply str (map #(encrypt % %) s)))))
>
> I specified the range the way I did because I wanted meaningful start and 
> end points, I don't have the code points for many characters memorized.
>

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to