aboutsummaryrefslogtreecommitdiffstats
path: root/src/cmd/bcrypt.cpp
diff options
context:
space:
mode:
authorSimon Warta <[email protected]>2015-12-08 19:56:19 +0100
committerSimon Warta <[email protected]>2015-12-08 22:02:28 +0100
commit368d087e3973db9d8c5b70443d31c27c03dfdbef (patch)
tree9059a52c70eee8b825d9fd7fa14194940853b86a /src/cmd/bcrypt.cpp
parent53fca25da331d168b0433ba2e41b06aae9d17f5c (diff)
Replace C interfaces in cli apps with C++ interfaces
Diffstat (limited to 'src/cmd/bcrypt.cpp')
-rw-r--r--src/cmd/bcrypt.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/cmd/bcrypt.cpp b/src/cmd/bcrypt.cpp
index 3cf5f7516..81f7c536e 100644
--- a/src/cmd/bcrypt.cpp
+++ b/src/cmd/bcrypt.cpp
@@ -12,21 +12,21 @@
namespace {
-int bcrypt(int argc, char* argv[])
+int bcrypt(const std::vector<std::string> &args)
{
- if(argc == 2)
+ if(args.size() == 2)
{
AutoSeeded_RNG rng;
- const std::string password = argv[1];
+ const std::string password = args[1];
std::cout << generate_bcrypt(password, rng, 12) << std::endl;
return 0;
}
- else if(argc == 3)
+ else if(args.size() == 3)
{
- const std::string password = argv[1];
- const std::string hash = argv[2];
+ const std::string password = args[1];
+ const std::string hash = args[2];
if(hash.length() != 60)
std::cout << "Note: bcrypt '" << hash << "' has wrong length and cannot be valid" << std::endl;
@@ -37,8 +37,8 @@ int bcrypt(int argc, char* argv[])
return (ok ? 0 : 1);
}
- std::cout << "Usage: " << argv[0] << " password\n"
- << " " << argv[0] << " password passhash" << std::endl;
+ std::cout << "Usage: " << args[0] << " password\n"
+ << " " << args[0] << " password passhash" << std::endl;
return 1;
}