Loading include/Statistics.h +2 −0 Original line number Diff line number Diff line Loading @@ -65,6 +65,8 @@ struct Statistics { minMax minMaxValue; }; std::ostream& operator<<(std::ostream& os, const Statistics& results); #pragma omp declare reduction(dataSum: Statistics : omp_out += omp_in ) initializer(omp_priv(omp_orig)) #endif // STATISTICS_H No newline at end of file src/core/Statistics.cpp +24 −2 Original line number Diff line number Diff line #include "Statistics.h" #include <iostream> #include "Statistics.h" #include "Utils.h" using namespace std; void minMax::updateMinMax(const minMax &m){ Loading Loading @@ -68,3 +69,24 @@ bool Statistics::operator==(const Statistics& o) const { && simplemasks == o.simplemasks && advancedmasks == o.advancedmasks; } 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(" << 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 << "\nmin - max\n" << endl; os << setw(43) << right << "digit: " << setw(2) << right << results.minMaxValue.mindigit << " - " << results.minMaxValue.maxdigit << endl; os << setw(43) << right << "lower: " << setw(2) << right << results.minMaxValue.minlower << " - " << results.minMaxValue.maxlower << endl; os << setw(43) << right << "upper: " << setw(2) << right << results.minMaxValue.minupper << " - " << results.minMaxValue.maxupper << endl; os << setw(43) << right << "special: " << setw(2) << right << results.minMaxValue.minspecial << " - " << results.minMaxValue.maxspecial << endl; return os; } No newline at end of file src/core/Statsgen.cpp +1 −20 Original line number Diff line number Diff line Loading @@ -76,11 +76,6 @@ int Statsgen::generate_stats() { void Statsgen::print_stats() const { int count; float perc = percentage(results.total_filter, results.total_counter); cout << "\n\tSelected " << results.total_filter << " on " << results.total_counter << " passwords\t(" << perc << " %)" << endl; cout << "\nSecurity rules : " << endl; cout << "\tMinimal length of a password: " << settings.sr.minLength << endl; Loading @@ -89,21 +84,7 @@ void Statsgen::print_stats() const { cout << "\tMinimum of lower characters in a password: " << settings.sr.minLower << endl; cout << "\tMinimum of upper characters in a password: " << settings.sr.minUpper << endl; float perce = percentage(results.nb_secure_passwords, results.total_counter); cout << "\n\t\t--> " << results.nb_secure_passwords << " passwords\t(" << perce << " %) respect the security rules\n" << endl; cout << "\nmin - max\n" << endl; cout << setw(43) << right << "digit: " << setw(2) << right << results.minMaxValue.mindigit << " - " << results.minMaxValue.maxdigit << endl; cout << setw(43) << right << "lower: " << setw(2) << right << results.minMaxValue.minlower << " - " << results.minMaxValue.maxlower << endl; cout << setw(43) << right << "upper: " << setw(2) << right << results.minMaxValue.minupper << " - " << results.minMaxValue.maxupper << endl; cout << setw(43) << right << "special: " << setw(2) << right << results.minMaxValue.minspecial << " - " << results.minMaxValue.maxspecial << endl; cout << results << endl; cout << "\nStatistics relative to length: \n" << endl; showMap(results.length, settings.top, results.total_counter, settings.hiderare, count); Loading Loading
include/Statistics.h +2 −0 Original line number Diff line number Diff line Loading @@ -65,6 +65,8 @@ struct Statistics { minMax minMaxValue; }; std::ostream& operator<<(std::ostream& os, const Statistics& results); #pragma omp declare reduction(dataSum: Statistics : omp_out += omp_in ) initializer(omp_priv(omp_orig)) #endif // STATISTICS_H No newline at end of file
src/core/Statistics.cpp +24 −2 Original line number Diff line number Diff line #include "Statistics.h" #include <iostream> #include "Statistics.h" #include "Utils.h" using namespace std; void minMax::updateMinMax(const minMax &m){ Loading Loading @@ -68,3 +69,24 @@ bool Statistics::operator==(const Statistics& o) const { && simplemasks == o.simplemasks && advancedmasks == o.advancedmasks; } 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(" << 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 << "\nmin - max\n" << endl; os << setw(43) << right << "digit: " << setw(2) << right << results.minMaxValue.mindigit << " - " << results.minMaxValue.maxdigit << endl; os << setw(43) << right << "lower: " << setw(2) << right << results.minMaxValue.minlower << " - " << results.minMaxValue.maxlower << endl; os << setw(43) << right << "upper: " << setw(2) << right << results.minMaxValue.minupper << " - " << results.minMaxValue.maxupper << endl; os << setw(43) << right << "special: " << setw(2) << right << results.minMaxValue.minspecial << " - " << results.minMaxValue.maxspecial << endl; return os; } No newline at end of file
src/core/Statsgen.cpp +1 −20 Original line number Diff line number Diff line Loading @@ -76,11 +76,6 @@ int Statsgen::generate_stats() { void Statsgen::print_stats() const { int count; float perc = percentage(results.total_filter, results.total_counter); cout << "\n\tSelected " << results.total_filter << " on " << results.total_counter << " passwords\t(" << perc << " %)" << endl; cout << "\nSecurity rules : " << endl; cout << "\tMinimal length of a password: " << settings.sr.minLength << endl; Loading @@ -89,21 +84,7 @@ void Statsgen::print_stats() const { cout << "\tMinimum of lower characters in a password: " << settings.sr.minLower << endl; cout << "\tMinimum of upper characters in a password: " << settings.sr.minUpper << endl; float perce = percentage(results.nb_secure_passwords, results.total_counter); cout << "\n\t\t--> " << results.nb_secure_passwords << " passwords\t(" << perce << " %) respect the security rules\n" << endl; cout << "\nmin - max\n" << endl; cout << setw(43) << right << "digit: " << setw(2) << right << results.minMaxValue.mindigit << " - " << results.minMaxValue.maxdigit << endl; cout << setw(43) << right << "lower: " << setw(2) << right << results.minMaxValue.minlower << " - " << results.minMaxValue.maxlower << endl; cout << setw(43) << right << "upper: " << setw(2) << right << results.minMaxValue.minupper << " - " << results.minMaxValue.maxupper << endl; cout << setw(43) << right << "special: " << setw(2) << right << results.minMaxValue.minspecial << " - " << results.minMaxValue.maxspecial << endl; cout << results << endl; cout << "\nStatistics relative to length: \n" << endl; showMap(results.length, settings.top, results.total_counter, settings.hiderare, count); Loading