make randomness non-deterministic
This commit is contained in:
parent
48aba74b6d
commit
5e70cd6b0f
1 changed files with 2 additions and 2 deletions
|
@ -6,10 +6,10 @@ import Crypto.Error (CryptoFailable)
|
|||
import qualified Data.ByteString as BS
|
||||
import Data.ByteString.Base64
|
||||
|
||||
import System.Random.Stateful (uniformByteStringM, newIOGenM, mkStdGen)
|
||||
import System.Random.Stateful (uniformByteStringM, newIOGenM, initStdGen)
|
||||
|
||||
randomString :: IO BS.ByteString
|
||||
randomString = encode <$> (uniformByteStringM 32 =<< newIOGenM (mkStdGen 23))
|
||||
randomString = encode <$> (uniformByteStringM 32 =<< newIOGenM =<< initStdGen)
|
||||
|
||||
argon2 :: BS.ByteString -> BS.ByteString -> CryptoFailable BS.ByteString
|
||||
argon2 salt payload = encode <$> hash defaultOptions payload (decodeLenient salt) 64
|
||||
|
|
Loading…
Reference in a new issue