api basic routes
This commit is contained in:
23
include/utils.hpp
Normal file
23
include/utils.hpp
Normal file
@@ -0,0 +1,23 @@
|
||||
#ifndef UTILS_HPP
|
||||
#define UTILS_HPP
|
||||
#include <string>
|
||||
#include <chrono>
|
||||
#include <sstream>
|
||||
#include <iomanip>
|
||||
|
||||
namespace hashing {
|
||||
std::string GenerateSetting(unsigned long cost = 0);
|
||||
std::string HashPassword(const std::string& password, const std::string& setting);
|
||||
bool VerifyPassword(const std::string& password, const std::string& stored_password);
|
||||
std::string generate_token(size_t bytes = 32);
|
||||
}
|
||||
|
||||
namespace timestamp {
|
||||
typedef std::chrono::system_clock::time_point Timestamp;
|
||||
|
||||
Timestamp ParseTimestamp(const std::string& ts);
|
||||
Timestamp Now();
|
||||
std::string FormatTimestamp(const Timestamp& ts);
|
||||
}
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user