generated from Sithas/conan_template
Рабочая сборка с третьей ручкой
This commit is contained in:
@@ -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_;
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
};
|
||||
}
|
||||
@@ -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;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user