-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpasswordChecker.h
More file actions
37 lines (28 loc) · 855 Bytes
/
passwordChecker.h
File metadata and controls
37 lines (28 loc) · 855 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
// passwordChecker.h
#ifndef DESKTOP_PASSWORDCHECKER_H
#define DESKTOP_PASSWORDCHECKER_H
#include <string>
#include <cstddef>
struct passwordAnalysis {
std::size_t length = 0;
bool min_length = false; // >= 8
bool max_length = false; // <= 16 (per your original spec)
bool uppercase = false;
bool lowercase = false;
bool digit = false;
bool special_char = false;
bool whitespace = false;
bool sequence = false;
bool common_pattern = false;
std::size_t repeat_run = 0;
bool is_valid = false;
};
// Simple strength output
enum class Strength { Weak, Medium, Strong };
struct StrengthResult {
int score = 0; // 0–10
Strength strength = Strength::Weak;
};
passwordAnalysis analyze(const std::string& pw);
StrengthResult rate_strength(const passwordAnalysis& a);
#endif