Рабочая сборка с третьей ручкой

This commit is contained in:
Антон
2025-09-27 13:34:30 +03:00
parent d4c01cd70c
commit d8cbdaf635
11 changed files with 58 additions and 118 deletions
-45
View File
@@ -1,45 +0,0 @@
#include <iostream>
#include <string>
#include "User.h"
using namespace std;
namespace uad
{
const string& User::GetUUID() const noexcept
{
return uuid_;
}
void User::SetUUID(const string& new_uuid)
{
uuid_ = new_uuid;
}
const string& User::GetLogin() const noexcept
{
return login_;
}
void User::SetLogin(const string& login)
{
login_ = login;
}
void User::SetPassword(const string& password)
{
size_t calculated_hash = hash<string>{}(password);
hashed_password_ = ToHex((byte*)&calculated_hash, sizeof(calculated_hash));
}
void User::SetHashedPassword(const std::string& hashed_password)
{
hashed_password_ = hashed_password;
}
const string& User::GetHashedPassword() const noexcept
{
return hashed_password_;
}
}
-29
View File
@@ -1,29 +0,0 @@
#pragma once
#include <string>
#include "../helpers/helpers.h"
namespace uad
{
class User
{
std::string uuid_;
std::string login_;
std::string hashed_password_;
public:
[[nodiscard]] const std::string& GetUUID() const noexcept;
void SetUUID(const std::string& new_uuid);
[[nodiscard]] const std::string& GetLogin() const noexcept;
void SetLogin(const std::string& login);
void SetPassword(const std::string& password);
void SetHashedPassword(const std::string& hashed_password);
[[nodiscard]] const std::string& GetHashedPassword() const noexcept;
};
}
+15
View File
@@ -0,0 +1,15 @@
#pragma once
#include <string>
#include "../helpers/helpers.h"
namespace uad
{
struct user
{
std::string uuid;
std::string login;
std::string hashed_password;
};
}