MCPcopy Create free account
hub / github.com/antirez/llama.cpp-deepseek-v4-flash / random_string

Function random_string

tests/test-jinja.cpp:2099–2110  ·  view source on GitHub ↗

Helper to generate random string

Source from the content-addressed store, hash-verified

2097
2098// Helper to generate random string
2099static std::string random_string(std::mt19937 & rng, size_t max_len) {
2100 static const char charset[] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_";
2101 std::uniform_int_distribution<size_t> len_dist(0, max_len);
2102 std::uniform_int_distribution<size_t> char_dist(0, sizeof(charset) - 2);
2103 size_t len = len_dist(rng);
2104 std::string result;
2105 result.reserve(len);
2106 for (size_t i = 0; i < len; ++i) {
2107 result += charset[char_dist(rng)];
2108 }
2109 return result;
2110}
2111
2112// Helper to execute a fuzz test case - returns true if no crash occurred
2113static bool fuzz_test_template(const std::string & tmpl, const json & vars) {

Callers 1

test_fuzzingFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected