Main Page | Modules | File List | File Members

Pseudo random number generator functions

PRNG functions. More...

Functions

GShandle StartNumberGenerator (GSCRYPTO_PRNG_ALGO eAlgo, GSCRYPTO_HASH_ALGO eHash, const GSubyte *pucSeed, GSuint uiSeedSize)
 Initialize the pseudo-random number generator.

GSvoid StopNumberGenerator (GShandle hPRNG)
 Uninitiaze the pseudo-random number generator.

GSubyte GenerateBit (GShandle hPRNG)
 Generate random bit.

GSubyte GenerateByte (GShandle hPRNG)
 Generate random byte.

GSulong GenerateNumber (GShandle hPRNG, GSulong ulMax=(GSulong)-1, GSulong ulMin=0)
 Generate random number.

GSvoid GenerateBlock (GShandle hPRNG, GSubyte *pucBlock, GSuint uiBlockSize)
 Generate random array of bytes.


Detailed Description

These functions are used to get random pseudo-generated numbers

Function Documentation

GSubyte GenerateBit GShandle  hPRNG  ) 
 

Description:
This function is used to generate a random bit
Returns:
Generated bit
Parameters:
hPRNG Handle on the PRNG object

GSvoid GenerateBlock GShandle  hPRNG,
GSubyte *  pucBlock,
GSuint  uiBlockSize
 

Description:
This function is used to generate a random array of bytes
Returns:
void
Parameters:
hPRNG Handle on the PRNG object
pucBlock Pointer to a block of byte to fill
uiBlockSize Block size

GSubyte GenerateByte GShandle  hPRNG  ) 
 

Description:
This function is used to generate a random byte
Returns:
Generated byte
Parameters:
hPRNG Handle on the PRNG object

GSulong GenerateNumber GShandle  hPRNG,
GSulong  ulMax = (GSulong)-1,
GSulong  ulMin = 0
 

Description:
This function is used to generate a random number
Returns:
Generated number
Parameters:
hPRNG Handle on the PRNG object
ulMax Highest possible number that can be generated
ulMin Lowest possible number that can be generated

GShandle StartNumberGenerator GSCRYPTO_PRNG_ALGO  eAlgo,
GSCRYPTO_HASH_ALGO  eHash,
const GSubyte *  pucSeed,
GSuint  uiSeedSize
 

Description:
Initialize the pseudo-random number generator
Returns:
Status of the function call
Return values:
Identification of the PRNG algorithm created
NULL if the operation failed
Parameters:
eAlgo The algo to use for the pseudo-random number generator
eHash The algo to use for the hash algorithm in the prng
pucSeed The seed value
uiSeedSize The size of the seed

GSvoid StopNumberGenerator GShandle  hPRNG  ) 
 

Description:
Uninitiaze the pseudo-random number generator
Returns:
void
Parameters:
hPRNG Handle on the PRNG object


Ubi.com GameService SDK - ©UbiSoft Entertainment 2002
GameService development team