Files
zoneminder/dep/libbcrypt/src/main.cpp
Peter Keresztes Schmidt c33b5a4393 Move in-tree dependencies to their own folder
src/ should only contain our code. Move the in-tree dependencies to dep/
This allows us (if necessary) to e.g. exclude that part of the tree from being analyzed by
various tools or mark it as external code in IDEs.
2021-02-28 02:12:07 +01:00

20 lines
570 B
C++

#include "bcrypt/BCrypt.hpp"
#include <iostream>
int main(){
std::string right_password = "right_password";
std::string wrong_password = "wrong_password";
std::cout << "generate hash... " << std::flush;
std::string hash = BCrypt::generateHash(right_password, 12);
std::cout << "done." << std::endl;
std::cout << "checking right password: " << std::flush
<< BCrypt::validatePassword(right_password,hash) << std::endl;
std::cout << "checking wrong password: " << std::flush
<< BCrypt::validatePassword(wrong_password,hash) << std::endl;
return 0;
}