documentation added + more sophisticated settings file reader

This commit is contained in:
Christian Mueller
2012-06-13 20:24:30 +02:00
parent 836deda0e5
commit b5a23b6f09
6 changed files with 82 additions and 34 deletions
+5 -3
View File
@@ -1,9 +1,11 @@
(ns NoteHub.crossover.lib
(:refer-clojure :exclude [hash]))
; very simple hash function %)
; (doesn't work for UTF-16!)
(defn hash [f s]
(defn hash
"A simple hash-function, which computes a hash from the text field
content and given session number. It is intended to be used as a spam
protection / captcha alternative. (Probably doesn't work for URF-16)"
[f s]
(let [short-mod #(mod % 32767)
char-codes (map f
(filter #(not (contains? #{"\n" "\r"} %)) (map str s)))]