Loading CMakeLists.txt +3 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ add_executable(cppack src/core/Policy.cpp src/core/Statistics.cpp src/core/Utils.cpp src/core/SecurityRules.cpp src/cli/Main.cpp) target_link_libraries(cppack ${CMAKE_THREAD_LIBS_INIT}) Loading Loading @@ -45,6 +46,7 @@ if(Qt5Core_FOUND) src/core/Policy.cpp src/core/Statistics.cpp src/core/Utils.cpp src/core/SecurityRules.cpp ressources/logos.qrc ) Loading @@ -60,5 +62,6 @@ add_executable(cppack-test src/core/Policy.cpp src/core/Statistics.cpp src/core/Utils.cpp src/core/SecurityRules.cpp src/test/cppack-tests.cpp) target_link_libraries(cppack-test ${CMAKE_THREAD_LIBS_INIT}) No newline at end of file include/SecurityRules.h +3 −0 Original line number Diff line number Diff line #ifndef SECURITY_RULES_H #define SECURITY_RULES_H #include <ostream> struct SecurityRules { uint minLength; Loading @@ -11,5 +12,7 @@ struct SecurityRules { bool operator==(const SecurityRules& o) const; }; std::ostream& operator<<(std::ostream& os, const SecurityRules& sec); #endif No newline at end of file include/Utils.h +2 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,8 @@ #include <iomanip> #include <sstream> typedef unsigned int uint; inline float percentage(const float& num, const float& den){ return 100 * num / den; } Loading src/core/Statistics.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -73,11 +73,11 @@ bool Statistics::operator==(const Statistics& o) const { std::ostream& operator<<(std::ostream& os, const Statistics& results){ float perc = percentage(results.total_filter, results.total_counter); os << "\n\tSelected " << results.total_filter << " on " << results.total_counter << " passwords\t(" os << "\nSelected " << results.total_filter << " on " << results.total_counter << " passwords\t(" << perc << " %)" << endl; perc = percentage(results.nb_secure_passwords, results.total_counter); os << "\n\t\t--> " << results.nb_secure_passwords << " passwords\t(" << perce << " %) respect the security rules\n" << endl; os << "\n\t\t--> " << results.nb_secure_passwords << " passwords\t(" << perc << " %) respect the security rules\n" << endl; os << "\nmin - max\n" << endl; os << setw(43) << right << "digit: " Loading src/core/Statsgen.cpp +1 −8 Original line number Diff line number Diff line Loading @@ -76,14 +76,7 @@ int Statsgen::generate_stats() { void Statsgen::print_stats() const { int count; cout << "\nSecurity rules : " << endl; cout << "\tMinimal length of a password: " << settings.sr.minLength << endl; cout << "\tMinimum of special characters in a password: " << settings.sr.minSpecial << endl; cout << "\tMinimum of digits in a password: " << settings.sr.minDigit << endl; cout << "\tMinimum of lower characters in a password: " << settings.sr.minLower << endl; cout << "\tMinimum of upper characters in a password: " << settings.sr.minUpper << endl; cout << settings.sr << endl; cout << results << endl; cout << "\nStatistics relative to length: \n" << endl; Loading Loading
CMakeLists.txt +3 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ add_executable(cppack src/core/Policy.cpp src/core/Statistics.cpp src/core/Utils.cpp src/core/SecurityRules.cpp src/cli/Main.cpp) target_link_libraries(cppack ${CMAKE_THREAD_LIBS_INIT}) Loading Loading @@ -45,6 +46,7 @@ if(Qt5Core_FOUND) src/core/Policy.cpp src/core/Statistics.cpp src/core/Utils.cpp src/core/SecurityRules.cpp ressources/logos.qrc ) Loading @@ -60,5 +62,6 @@ add_executable(cppack-test src/core/Policy.cpp src/core/Statistics.cpp src/core/Utils.cpp src/core/SecurityRules.cpp src/test/cppack-tests.cpp) target_link_libraries(cppack-test ${CMAKE_THREAD_LIBS_INIT}) No newline at end of file
include/SecurityRules.h +3 −0 Original line number Diff line number Diff line #ifndef SECURITY_RULES_H #define SECURITY_RULES_H #include <ostream> struct SecurityRules { uint minLength; Loading @@ -11,5 +12,7 @@ struct SecurityRules { bool operator==(const SecurityRules& o) const; }; std::ostream& operator<<(std::ostream& os, const SecurityRules& sec); #endif No newline at end of file
include/Utils.h +2 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,8 @@ #include <iomanip> #include <sstream> typedef unsigned int uint; inline float percentage(const float& num, const float& den){ return 100 * num / den; } Loading
src/core/Statistics.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -73,11 +73,11 @@ bool Statistics::operator==(const Statistics& o) const { std::ostream& operator<<(std::ostream& os, const Statistics& results){ float perc = percentage(results.total_filter, results.total_counter); os << "\n\tSelected " << results.total_filter << " on " << results.total_counter << " passwords\t(" os << "\nSelected " << results.total_filter << " on " << results.total_counter << " passwords\t(" << perc << " %)" << endl; perc = percentage(results.nb_secure_passwords, results.total_counter); os << "\n\t\t--> " << results.nb_secure_passwords << " passwords\t(" << perce << " %) respect the security rules\n" << endl; os << "\n\t\t--> " << results.nb_secure_passwords << " passwords\t(" << perc << " %) respect the security rules\n" << endl; os << "\nmin - max\n" << endl; os << setw(43) << right << "digit: " Loading
src/core/Statsgen.cpp +1 −8 Original line number Diff line number Diff line Loading @@ -76,14 +76,7 @@ int Statsgen::generate_stats() { void Statsgen::print_stats() const { int count; cout << "\nSecurity rules : " << endl; cout << "\tMinimal length of a password: " << settings.sr.minLength << endl; cout << "\tMinimum of special characters in a password: " << settings.sr.minSpecial << endl; cout << "\tMinimum of digits in a password: " << settings.sr.minDigit << endl; cout << "\tMinimum of lower characters in a password: " << settings.sr.minLower << endl; cout << "\tMinimum of upper characters in a password: " << settings.sr.minUpper << endl; cout << settings.sr << endl; cout << results << endl; cout << "\nStatistics relative to length: \n" << endl; Loading