This module includes functions that generates non cryptographic random numbers.

Functions

uint32_t otRandomNonCryptoGetUint32 (void)
This function generates and returns a random uint32_t value.
uint8_t otRandomNonCryptoGetUint8 (void)
This function generates and returns a random byte.
uint16_t otRandomNonCryptoGetUint16 (void)
This function generates and returns a random uint16_t value.
uint8_t otRandomNonCryptoGetUint8InRange (uint8_t aMin, uint8_t aMax)
This function generates and returns a random uint8_t value within a given range [aMin, aMax) .
uint16_t otRandomNonCryptoGetUint16InRange (uint16_t aMin, uint16_t aMax)
This function generates and returns a random uint16_t value within a given range [aMin, aMax) .
uint32_t otRandomNonCryptoGetUint32InRange (uint32_t aMin, uint32_t aMax)
This function generates and returns a random uint32_t value within a given range [aMin, aMax) .
void otRandomNonCryptoFillBuffer (uint8_t *aBuffer, uint16_t aSize)
This function fills a given buffer with random bytes.
uint32_t otRandomNonCryptoAddJitter (uint32_t aValue, uint16_t aJitter)
This function adds a random jitter within a given range to a given value.

Detailed Description

This module includes functions that generates non cryptographic random numbers.

Function Documentation

otRandomNonCryptoAddJitter()

uint32_t otRandomNonCryptoAddJitter ( uint32_t aValue,
uint16_t aJitter
)

This function adds a random jitter within a given range to a given value.

Parameters
[in] aValue A value to which the random jitter is added.
[in] aJitter Maximum jitter. Random jitter is selected from the range [-aJitter, aJitter] .
Returns
The given value with an added random jitter.

otRandomNonCryptoFillBuffer()

void otRandomNonCryptoFillBuffer ( uint8_t * aBuffer,
uint16_t aSize
)

This function fills a given buffer with random bytes.

Parameters
[out] aBuffer A pointer to a buffer to fill with the random bytes.
[in] aSize Size of buffer (number of bytes to fill).

otRandomNonCryptoGetUint16()

uint16_t otRandomNonCryptoGetUint16 ( void )

This function generates and returns a random uint16_t value.

Returns
A random uint16_t value.

otRandomNonCryptoGetUint16InRange()

uint16_t otRandomNonCryptoGetUint16InRange ( uint16_t aMin,
uint16_t aMax
)

This function generates and returns a random uint16_t value within a given range [aMin, aMax) .

Note
The returned random value can include the aMin value but excludes the aMax .
Parameters
[in] aMin A minimum value (this value can be included in returned random result).
[in] aMax A maximum value (this value is excluded from returned random result).
Returns
A random uint16_t value in the given range (i.e., aMin <= random value < aMax).

otRandomNonCryptoGetUint32()

uint32_t otRandomNonCryptoGetUint32 ( void )

This function generates and returns a random uint32_t value.

Returns
A random uint32_t value.

otRandomNonCryptoGetUint32InRange()

uint32_t otRandomNonCryptoGetUint32InRange ( uint32_t aMin,
uint32_t aMax
)

This function generates and returns a random uint32_t value within a given range [aMin, aMax) .

Note
The returned random value can include the aMin value but excludes the aMax .
Parameters
[in] aMin A minimum value (this value can be included in returned random result).
[in] aMax A maximum value (this value is excluded from returned random result).
Returns
A random uint32_t value in the given range (i.e., aMin <= random value < aMax).

otRandomNonCryptoGetUint8()

uint8_t otRandomNonCryptoGetUint8 ( void )

This function generates and returns a random byte.

Returns
A random uint8_t value.

otRandomNonCryptoGetUint8InRange()

uint8_t otRandomNonCryptoGetUint8InRange ( uint8_t aMin,
uint8_t aMax
)

This function generates and returns a random uint8_t value within a given range [aMin, aMax) .

Parameters
[in] aMin A minimum value (this value can be included in returned random result).
[in] aMax A maximum value (this value is excluded from returned random result).
Returns
A random uint8_t value in the given range (i.e., aMin <= random value < aMax).