Contiki-NG
Pseudo Random Number Generator (PRNG) for CC13xx/CC26xx.

Implementation based on Bob Jenkins' small noncryptographic PRNG. More...

Files

 

Functions

unsigned short random_rand (void)
 Generates a new random number using the PRNG. More...
 
void random_init (unsigned short seed)
 Initialize the PRNG. More...
 

Detailed Description

Implementation based on Bob Jenkins' small noncryptographic PRNG.

This file overrides os/lib/random.c. Note that the file name must match the original file for the override to work.

Function Documentation

◆ random_init()

void random_init ( unsigned short  seed)

Initialize the PRNG.

Seed the cc2538 random number generator.

Parameters
seedSeed for the PRNG.

Definition at line 87 of file random.c.

◆ random_rand()

unsigned short random_rand ( void  )

Generates a new random number using the PRNG.

Generates a new random number using the cc2538 RNG.

Returns
The random number.

Definition at line 69 of file random.c.