Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- HashFunction HashFunction::getHashCoefs(const int k_value, const int prime_module) {
- using std::uniform_int_distribution;
- static uniform_int_distribution<int> distribution(0, prime_module - 1);
- static uniform_int_distribution<int> distribution_for_previous_coef(1, prime_module - 1);
- static std::default_random_engine generator;
- vector<int64_t> coefs;
- for (size_t i = 0; i < k_value - 1; ++i) {
- coefs.push_back(distribution(generator));
- }
- coefs.push_back(distribution_for_previous_coef(generator));
- return HashFunction(coefs, prime_module);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement