mirror of
https://github.com/ZeroTier/ZeroTierOne
synced 2025-07-14 17:13:15 -07:00
Add a fast non-cryptographic PRNG.
This commit is contained in:
parent
c6dd5b239f
commit
3e49337d9a
10 changed files with 107 additions and 20 deletions
|
@ -115,11 +115,12 @@ public:
|
|||
|
||||
/**
|
||||
* Clear a random bit in this bloom filter
|
||||
*
|
||||
* @param rn Random number
|
||||
*/
|
||||
inline void decay()
|
||||
inline void decay(unsigned int rn)
|
||||
throw()
|
||||
{
|
||||
const unsigned int rn = Utils::randomInt<unsigned int>();
|
||||
_field[(rn >> 3) % (B / 8)] &= ~((unsigned char)(1 << (rn & 7)));
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue