Random
public struct Random
This can be used to securely generate random data.
-
Securely generate a random sequence of bytes.
Declaration
Swift
public static func bytes(count: UInt32) -> BytesParameters
countThe amount of bytes.
-
Securely generate a random number.
Declaration
Swift
public static func number() -> UInt32 -
Securely generate a random number with a given upper bound. The result has a uniform distribution in the Range of
0..<upperBound.Declaration
Swift
public static func number(withUpperBound upperBound: UInt32) -> UInt32
View on GitHub
Random Structure Reference