Revert to the older faster toChar. I would have just removed the
old commit from history but it seems that would call for a rebase
which I hear is a bad idea in a public branch. Thus this commit.
This commit is contained in:
Björn Buckwalter 2011-09-21 21:53:57 +08:00
parent f23ca419e9
commit 4d1ea8520a

View File

@ -75,7 +75,10 @@ parseWaiRequest' env session' key' gen = Request gets'' cookies' env langs' nonc
randomString :: RandomGen g => Int -> g -> String
randomString len = take len . map toChar . randomRs (0, 61)
where
toChar i = (['A'..'Z'] ++ ['a'..'z'] ++ ['0'..'9']) !! i
toChar i
| i < 26 = toEnum $ i + fromEnum 'A'
| i < 52 = toEnum $ i + fromEnum 'a' - 26
| otherwise = toEnum $ i + fromEnum '0' - 52
-- | A tuple containing both the POST parameters and submitted files.
type RequestBodyContents =