Safe Haskell | None |
---|---|
Language | Haskell2010 |
Generate cryptographically-secure random data.
Synopsis
- generate :: forall ba n. (ByteArray ba, KnownNat n) => IO (SizedByteArray n ba)
Documentation
generate :: forall ba n. (ByteArray ba, KnownNat n) => IO (SizedByteArray n ba) Source #
Generate a sequence of cryptographically-secure random bytes.
The output of this function is suitable to generate secret keys.
Note: This function is not thread-safe until Sodium is initialised. See Crypto.Init for details.