mirror of
https://github.com/aaronpo97/the-biergarten-app.git
synced 2026-07-16 17:47:22 +00:00
* Refactor ApplicationOptions to separate config concerns * add prompt dir app option * readability updates: remove magic numbers, update comments * codebase formatting * Update docs * Extract argument parsing, timer out of
23 lines
657 B
C++
23 lines
657 B
C++
/**
|
|
* @file data_generation/mock/generate_user.cc
|
|
* @brief Generates deterministic mock user profiles by hashing locale values
|
|
* into predefined username and bio collections.
|
|
*/
|
|
|
|
#include <functional>
|
|
#include <string>
|
|
#include <string_view>
|
|
|
|
#include "data_generation/mock_generator.h"
|
|
|
|
UserResult MockGenerator::GenerateUser(const std::string& locale) {
|
|
const size_t hash = std::hash<std::string>{}(locale);
|
|
|
|
UserResult result;
|
|
const std::string_view username = kUsernames[hash % kUsernames.size()];
|
|
const std::string_view bio = kBios[hash / kBioHashStride % kBios.size()];
|
|
result.username = username;
|
|
result.bio = bio;
|
|
return result;
|
|
}
|