MCPcopy Create free account
hub / github.com/RobTillaart/Arduino / getRandom8

Function getRandom8

libraries/randomHelpers/randomHelpers.cpp:138–149  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

136
137
138uint8_t getRandom8()
139{
140 if (__randomIdx < 8)
141 {
142 __randomBuffer = getRandom32();
143 __randomIdx = 32;
144 }
145 uint8_t rv = __randomBuffer & 0xFF;
146 __randomBuffer >>= 8;
147 __randomIdx -= 8;
148 return rv;
149}
150
151
152uint16_t getRandom16()

Callers 1

unittestFunction · 0.85

Calls 1

getRandom32Function · 0.85

Tested by 1

unittestFunction · 0.68