Older/Base/DataStructure.h
2025-03-01 09:09:30 +00:00

34 lines
754 B
C++

#ifndef __DATASTRUCTURE_H__
#define __DATASTRUCTURE_H__
#include <cstdint>
#include <string>
#include <vector>
namespace Older {
struct VisitorStats {
std::string url;
int visitorCount = 0;
int totalViews = 0;
int64_t lastViewTime = 0;
};
struct SiteStats {
int totalViews = 0;
int totalVisitors = 0;
};
struct Account {
int64_t id = 0;
std::string username;
std::string email;
std::vector<uint8_t> passwordHash;
std::vector<uint8_t> salt;
int64_t createdAt = 0;
static Account hashPassword(const std::string &password);
static bool verifyPassword(const Account &account, const std::string &password);
static bool validateEmail(const std::string& email);
};}
#endif // __DATASTRUCTURE_H__