hashmap-bench/src/generator.cpp

28 lines
564 B
C++
Raw Normal View History

2020-02-03 18:10:29 +00:00
#include "./includes/generator.h"
std::string gen_string() { // 90^size posibilities
std::string randomstring;
for (int i = 0; i < 5; ++i) {
2020-02-05 16:56:39 +00:00
randomstring += singlechar(generator);
2020-02-03 18:10:29 +00:00
}
return randomstring;
}
std::string gen_unsuccesfull_string() { // 90^size posibilities
std::string randomstring;
for (int i = 0; i < 4; ++i) {
2020-02-05 16:56:39 +00:00
randomstring += singlechar(generator);//
2020-02-03 18:10:29 +00:00
}
return randomstring;
}
int gen_int(){
2020-02-05 16:56:39 +00:00
return insert_int(generator);
2020-02-03 18:10:29 +00:00
}
int gen_unsuccesfull_int(){
2020-02-05 16:56:39 +00:00
return noninsert_int(generator);
}