mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2026-08-08 08:33:39 +08:00
PPP, MAGIC: new function: magic_pow
magic_pow() returns a new random number between 0 and (2^pow)-1 included.
This commit is contained in:
@@ -264,4 +264,11 @@ u32_t magic() {
|
||||
|
||||
#endif /* PPP_MD5_RANDM */
|
||||
|
||||
/*
|
||||
* Return a new random number between 0 and (2^pow)-1 included.
|
||||
*/
|
||||
u32_t magic_pow(u8_t pow) {
|
||||
return magic() & ~(~0UL<<pow);
|
||||
}
|
||||
|
||||
#endif /* PPP_SUPPORT */
|
||||
|
||||
Reference in New Issue
Block a user