noir-clojure / lib-noir

A set of libraries for ring apps, including stateful sessions.
Eclipse Public License 1.0
481 stars 47 forks source link

Added some common website hashing functions #27

Closed runexec closed 11 years ago

runexec commented 11 years ago
noir.util.crypt=> (noir.util.crypt/md5 "abc")
"900150983cd24fb0d6963f7d28e17f72"
noir.util.crypt=> (noir.util.crypt/sha1 "abc")
"a9993e364706816aba3e25717850c26c9cd0d89d"
noir.util.crypt=> (noir.util.crypt/sha2 "abc")
"ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad"
noir.util.crypt=> (noir.util.crypt/sha2 "abc" "salty")
"da3a54b1d94374ac909dcb5f34874a9f86b167040511023de41342e6f6e1222c"
Raynes commented 11 years ago

This looks great but I just laid down in bed. I'll merge it tomorrow if @yogthos doesn't get to it first.

yogthos commented 11 years ago

I like it too :) one question is there any particular for reason for using ^{:private true} over (defn- ...)

runexec commented 11 years ago

@yogthos I did it out of habbit, but you're correct, it should be (defn- ). I usually write private dynamic symbols so, I often have to do

^{:private true :dynamic true}