mirror of
https://github.com/nmap/nmap.git
synced 2026-08-04 14:49:29 +00:00
Merge r30177 from nmap-npingchanges: Add function to generate random 64-bit unsigned integers
Originally committed by luis but recommitted by david after recovery from backup.
This commit is contained in:
parent
c4c197b213
commit
ebea23e398
2 changed files with 8 additions and 0 deletions
|
|
@ -479,6 +479,7 @@ int get_random_bytes(void *buf, int numbytes);
|
|||
int get_random_int();
|
||||
unsigned short get_random_ushort();
|
||||
unsigned int get_random_uint();
|
||||
u64 get_random_u64();
|
||||
u32 get_random_u32();
|
||||
u16 get_random_u16();
|
||||
u8 get_random_u8();
|
||||
|
|
|
|||
|
|
@ -238,6 +238,13 @@ unsigned int get_random_uint() {
|
|||
return i;
|
||||
}
|
||||
|
||||
u64 get_random_u64() {
|
||||
u64 i;
|
||||
get_random_bytes(&i, sizeof(i));
|
||||
return i;
|
||||
}
|
||||
|
||||
|
||||
u32 get_random_u32() {
|
||||
u32 i;
|
||||
get_random_bytes(&i, sizeof(i));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue