-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUser.h
More file actions
38 lines (28 loc) · 889 Bytes
/
User.h
File metadata and controls
38 lines (28 loc) · 889 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
//
// Created by stefano on 12/08/20.
//
#ifndef SERVERBACKUP_USER_H
#define SERVERBACKUP_USER_H
#include <string>
class User {
private:
std::string username;
std::string salt;
std::string password;
std::string hash;
const static unsigned int N = 7;
std::string getHash(const std::string &password);
static std::string randomString(size_t length);
public:
User();
explicit User(const std::string& JSON);
User(std::string username, std::string hashPassword, std::string salt);
User(const User &user);
[[nodiscard]] const std::string &getUsername() const;
[[nodiscard]] const std::string &getPassword() const;
[[nodiscard]] const std::string &getHashedPassword() const;
[[nodiscard]] const std::string &getSalt() const;
void calculateHash();
void setSalt(const std::string &salt);
};
#endif //SERVERBACKUP_USER_H