Index: misc-stml.scm ================================================================== --- misc-stml.scm +++ misc-stml.scm @@ -128,10 +128,21 @@ (let loop ((res "") (n 1)) (if (> n len) res (loop (string-append res (session:get-rand-char)) (+ n 1))))) + +;; maybe replace above make-rand-string with this someday? +;; +(define (session:generic-make-rand-string len seed-string) + (let ((num-chars (string-length seed-string))) + (let loop ((res "") + (n 1)) + (let ((char-num (random num-chars))) + (if (> n len) res + (loop (string-append res (substring seed-string char-num (+ char-num 1))) + (+ n 1))))))) ;; Rely on crypt egg's default settings being secure enough, accept ;; backwards-compatible OpenSSL crypt passwords too. ;; (define (s:crypt-passwd pw s) @@ -153,10 +164,11 @@ (s:title err) (s:body (s:h1 "ERROR") (s:p err))))))) +;; BUG: The regex implements a rule, but what rule? AH! usaztempe, get rid of this? No, this also looks for &key=value ... (define (s:validate-uri) (let ((uri (get-environment-variable "REQUEST_URI")) (qrs (get-environment-variable "QUERY_STRING"))) (if (not uri) (set! uri qrs))