Skip to content

Commit 539795a

Browse files
committed
pass by preference for argparse
1 parent 69af2f8 commit 539795a

File tree

4 files changed

+10
-7
lines changed

4 files changed

+10
-7
lines changed

inc/BigInt.hpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
#ifndef BIG_INT_HPP
2+
#define BIG_INT_HPP
3+
4+
15
/*
26
BigInt
37
------
@@ -17,9 +21,6 @@
1721
Definition for the BigInt class.
1822
*/
1923

20-
#ifndef BIG_INT_HPP
21-
#define BIG_INT_HPP
22-
2324
#include <iostream>
2425

2526
class BigInt {

inc/pbkdf2_hmac.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// from Anti-weakpasswords transformed to modern C++ syntax
2+
// https://github.com/Anti-weakpasswords/PBKDF2-GCC-OpenSSL-library/blob/master/pbkdf2_openssl.c
13
#include <iostream>
24
#include <sstream>
35
#include <cstring>

lesspass-cpp

1.82 MB
Binary file not shown.

src/main.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ static const std::unordered_map< SUBSET, std::string > CHARACTER_MAP = {
2929
void _add_arguments( argparse::ArgumentParser & );
3030

3131
// get values required to generate salt
32-
std::unordered_map<std::string, std::string> create_salt_profile( argparse::ArgumentParser );
32+
std::unordered_map<std::string, std::string> create_salt_profile( argparse::ArgumentParser & );
3333

3434
// get salt value from site, login and counter hex value
3535
std::string _get_some_salt( std::unordered_map<std::string, std::string> );
@@ -38,7 +38,7 @@ std::string _get_some_salt( std::unordered_map<std::string, std::string> );
3838
BigInt calculate_entropy( std::string, std::string );
3939

4040
// get rules like uppercase? lowercase? ...
41-
std::vector< SUBSET > _get_rules( argparse::ArgumentParser );
41+
std::vector< SUBSET > _get_rules( argparse::ArgumentParser & );
4242

4343
// get characters based on the rules
4444
std::string _get_set_of_characters( std::vector< SUBSET > );
@@ -155,7 +155,7 @@ std::string _get_some_salt( std::unordered_map<std::string, std::string> profile
155155
return (profile[ "site" ] + profile[ "login" ] + util::int_to_hexstr( profile[ "counter" ] ));
156156
}
157157

158-
std::unordered_map<std::string, std::string> create_salt_profile( argparse::ArgumentParser args )
158+
std::unordered_map<std::string, std::string> create_salt_profile( argparse::ArgumentParser &args )
159159
{
160160
std::unordered_map<std::string, std::string> profile;
161161
profile.insert( { "site", args.get<std::string>( "--site" ) });
@@ -164,7 +164,7 @@ std::unordered_map<std::string, std::string> create_salt_profile( argparse::Argu
164164
profile.insert( { "pass", args.get<std::string>( "--pass" ) });
165165
return profile;
166166
}
167-
std::vector<SUBSET> _get_rules( argparse::ArgumentParser args )
167+
std::vector<SUBSET> _get_rules( argparse::ArgumentParser &args )
168168
{
169169
std::vector< SUBSET > rules;
170170
if ( args.get<bool>( "-l" ) ) { rules.push_back( SUBSET::lowercase ); }

0 commit comments

Comments
 (0)