Commit f289ef8b authored by Jorand Jean-baptiste's avatar Jorand Jean-baptiste
Browse files

resolution probleme pourcentage

parent 794e7842
Loading
Loading
Loading
Loading
+2 −2
Changes for Adaptation/include/statsgen.h: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -56,8 +56,8 @@ private:
	std::unordered_map<std::wstring, int> stats_charactersets;


	int total_counter = 0;
	int total_filter = 0;
	double total_counter = 0;
	double total_filter = 0;


	// Minimum password complexity counters
+13
Changes for Adaptation/include/utils.h: 13 added lines, 0 removed lines.
Original line number Diff line number Diff line
#include <map>


template<typename A>
std::multimap<int, A> flip_map(const std::map<A, int> & src) {
    std::multimap<int, A> dst;

    std::map<A, int>::const_iterator it;
    for(it = src.begin(); it != src.end(); ++it)
        dst.insert(std::pair<int, A>(it -> second, it -> first));

    return dst;
}
+1 −1
Changes for Adaptation/src/main.cpp: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -31,7 +31,7 @@ int main(int argc,char* argv[]) {
				i++;
			}

			else if (string(argv[i]) == "--regex") {
			else if (string(argv[i]) == "--regex" || string(argv[i]) == "-r") {
				if (argc == i+1) {
					wcerr << "Missing argument --top [value]" << endl;
					return -1;
+2 −2
Changes for Adaptation/src/statsgen.cpp: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -22,7 +22,7 @@ void Statsgen::showHelp() {

    wcout << "\t--hiderare, -hr\t\t:\tHide all statistics below 1%" << endl;
    wcout << "\t--top, -t [value]\t:\tShow only [value] first results" << endl;
    wcout << "\t--regex [value]\t\t:\tShow result for password, using the regular expression [value]" << endl;
    wcout << "\t--regex, -r [value]\t\t:\tShow result for password, using the regular expression [value]" << endl;

    wcout << "\n\nOptimisation options to reduce the execution time : " << endl;
    wcout << "\t--limitadvancedmasks, -lam [value]\t:\tLimit the size of the advanced masks at [value], if size>[value]: othermasks" << endl;
@@ -386,7 +386,7 @@ void Statsgen::readResult(int res, wstring carac, int & count) {

void Statsgen::print_stats() {
    int count;
    float perc = (float) (100*total_filter) / total_counter;
    float perc = (float) 100 * (total_filter / total_counter);

    wcout << "\n\tSelected " << total_filter << " on " << total_counter << " passwords\t(" 
        << perc << " %)" << endl;