Use stable random seed

This commit is contained in:
vvb2060
2023-03-08 06:52:09 +08:00
committed by John Wu
parent 5117dc1a31
commit 46ce765860
6 changed files with 56 additions and 24 deletions

View File

@@ -125,6 +125,7 @@ rust::Slice<uint8_t> byte_slice(T *buf, size_t sz) {
return rust::Slice(reinterpret_cast<uint8_t *>(buf), sz);
}
uint64_t parse_uint64_hex(std::string_view s);
int parse_int(std::string_view s);
using thread_entry = void *(*)(void *);
@@ -158,7 +159,7 @@ void init_argv0(int argc, char **argv);
void set_nice_name(const char *name);
uint32_t binary_gcd(uint32_t u, uint32_t v);
int switch_mnt_ns(int pid);
int gen_rand_str(char *buf, int len, bool varlen = true);
int gen_rand_str(char *buf, int len, const void *seed_buf = nullptr, bool varlen = true);
std::string &replace_all(std::string &str, std::string_view from, std::string_view to);
std::vector<std::string> split(const std::string &s, const std::string &delims);
std::vector<std::string_view> split_ro(std::string_view, std::string_view delims);