mirror of
https://github.com/nmap/nmap.git
synced 2025-12-06 04:31: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:
@@ -479,6 +479,7 @@ int get_random_bytes(void *buf, int numbytes);
|
|||||||
int get_random_int();
|
int get_random_int();
|
||||||
unsigned short get_random_ushort();
|
unsigned short get_random_ushort();
|
||||||
unsigned int get_random_uint();
|
unsigned int get_random_uint();
|
||||||
|
u64 get_random_u64();
|
||||||
u32 get_random_u32();
|
u32 get_random_u32();
|
||||||
u16 get_random_u16();
|
u16 get_random_u16();
|
||||||
u8 get_random_u8();
|
u8 get_random_u8();
|
||||||
|
|||||||
@@ -238,6 +238,13 @@ unsigned int get_random_uint() {
|
|||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
u64 get_random_u64() {
|
||||||
|
u64 i;
|
||||||
|
get_random_bytes(&i, sizeof(i));
|
||||||
|
return i;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
u32 get_random_u32() {
|
u32 get_random_u32() {
|
||||||
u32 i;
|
u32 i;
|
||||||
get_random_bytes(&i, sizeof(i));
|
get_random_bytes(&i, sizeof(i));
|
||||||
|
|||||||
Reference in New Issue
Block a user