MCPcopy Create free account
hub / github.com/apple/foundationdb / randomAddress

Method randomAddress

fdbrpc/IPAllowList.cpp:230–237  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

228
229 template <bool V4>
230 static IPAddress randomAddress() {
231 constexpr int width = V4 ? 4 : 16;
232 uint32_t rnd[width / 4];
233 for (int i = 0; i < width / 4; ++i) {
234 rnd[i] = deterministicRandom()->randomUInt32();
235 }
236 return intArrayToAddress<V4>(rnd);
237 }
238
239 template <bool V4>
240 IPAddress randomAddress(bool inSubnet) {

Callers 1

IPAllowList.cppFile · 0.80

Calls 8

deterministicRandomFunction · 0.85
randomUInt32Method · 0.80
isV4Method · 0.80
toV4Method · 0.80
netmaskMethod · 0.80
random01Method · 0.80
IPAddressClass · 0.50
sizeMethod · 0.45

Tested by

no test coverage detected