MCPcopy Create free account
hub / github.com/csmith-project/csmith / RandomHexDigits

Method RandomHexDigits

src/DefaultRndNumGenerator.cpp:189–204  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

187}
188
189std::string
190DefaultRndNumGenerator::RandomHexDigits( int num )
191{
192 if (!CGOptions::is_random())
193 return AbsRndNumGenerator::RandomHexDigits(num);
194
195 std::string str;
196 const char* hex1 = AbsRndNumGenerator::get_hex1();
197 while (num--) {
198 int x = genrand() % 16;
199 str += hex1[x];
200 seq_->add_number(x, 16, rand_depth_);
201 rand_depth_++;
202 }
203 return str;
204}
205
206std::string
207DefaultRndNumGenerator::RandomDigits( int num )

Callers

nothing calls this directly

Calls 2

RandomHexDigitsFunction · 0.85
add_numberMethod · 0.45

Tested by

no test coverage detected