-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcommon.hpp
More file actions
executable file
·32 lines (25 loc) · 987 Bytes
/
common.hpp
File metadata and controls
executable file
·32 lines (25 loc) · 987 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include <stdio.h>
#include <iostream>
#include <string>
#include <stddef.h>
#include <nlohmann/json.hpp>
#include <spdlog/spdlog.h>
#include <curl/curl.h>
#include <curl/options.h>
#include <openssl/sha.h>
#include <chrono>
#include <thread>
#include <fstream>
#include <filesystem>
#define LOG spdlog::info
#define ERRLOG spdlog::error
using json = nlohmann::json;
std::string makeHttpRequest(const std::string& url, const json& requestBody, const std::string& method);
std::string hashString(const std::string& source);
std::string generateString(int length);
std::string urlEncode(const std::string& source);
std::string base64_encode(const std::vector<unsigned char>& data);
std::string base64_imageFile(const std::string& base_dir, const std::string& filename);
std::string currentTime(const std::string &format);
std::vector<std::string> split(const std::string& s, char delimiter);
std::vector<std::string> split(const std::string& s, char delimiter, size_t minChunkSize);