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

Function getRandom4

libraries/randomHelpers/randomHelpers.cpp:81–92  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

79
80
81uint8_t getRandom4()
82{
83 if (__randomIdx < 4)
84 {
85 __randomBuffer = getRandom32();
86 __randomIdx = 32;
87 }
88 uint8_t rv = __randomBuffer & 0x0F;
89 __randomBuffer >>= 4;
90 __randomIdx -= 4;
91 return rv;
92}
93
94
95uint8_t getRandom5()

Callers 1

unittestFunction · 0.85

Calls 1

getRandom32Function · 0.85

Tested by 1

unittestFunction · 0.68