Fix pseudonym generation

This commit is contained in:
Gregor Kleen 2018-10-15 01:34:16 +02:00
parent 788b53946a
commit 4266683b15

View File

@ -547,8 +547,8 @@ instance PersistFieldSql Pseudonym where
sqlType _ = SqlInt32
instance Random Pseudonym where
randomR (lo, hi) gen = over _1 (fromIntegral :: Word32 -> Pseudonym) $ randomR (min 0 $ fromIntegral lo, max 0b111111111111 $ fromIntegral hi) gen
random = randomR (0, 0b111111111111)
randomR (max minBound -> lo, min maxBound -> hi) gen = over _1 (fromIntegral :: Word32 -> Pseudonym) $ randomR (fromIntegral lo, fromIntegral hi) gen
random = randomR (minBound, maxBound)
pseudonymWordlist :: [CI Text]
pseudonymWordlist = $(wordlist "config/wordlist.txt")