Core Function RandomSeed
From Sputnik Wiki
(Difference between revisions)
UberFoX (Talk | contribs)
(Created page with "<pre> RandomSeed( <flag> ) </pre> === Description === Generator a cryptographically strong random number for use as a seed. === Parameters === == flag == Optional; Type of r...")
Newer edit →
(Created page with "<pre> RandomSeed( <flag> ) </pre> === Description === Generator a cryptographically strong random number for use as a seed. === Parameters === == flag == Optional; Type of r...")
Newer edit →
Revision as of 23:39, 26 July 2014
RandomSeed( <flag> )
Contents |
Description
Generator a cryptographically strong random number for use as a seed.
Parameters
flag
Optional; Type of random number to generate.
0 = Generate a random unsigned Int32 1 = Generate a random unsigned Int64
Default: 0
Return Value
Success: Returns a cryptographically strong random number.
Failure: Return null.
Remarks
This uses the the .NET RNGCryptoServiceProvider to do the generating.
You can use the return value for anything that needs a good seed.
This can also be used to generate random numbers but RandomVar() is more generic for that task.
Example
$random = RandomSeed(); // 32 Bit $random = RandomSeed(1); // 64 Bit