Core Function RandomSeed

From Sputnik Wiki
Revision as of 23:39, 26 July 2014 by UberFoX (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
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
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox