-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathutil.h
executable file
·32 lines (28 loc) · 1.08 KB
/
util.h
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
#ifndef __util_h__
#define __util_h__
#include <string>
#include <vector>
#include <stdlib.h>
#include <iostream>
#include <fstream>
#include "includes/cryptopp/osrng.h"
#include "includes/cryptopp/cryptlib.h"
#include "includes/cryptopp/filters.h"
#include "includes/cryptopp/aes.h"
#include "includes/cryptopp/hex.h"
#include "includes/cryptopp/ccm.h"
std::string makeHash(const std::string& input);
std::string to_string(int number);
std::string to_string(double number);
std::string randomString(const unsigned int len);
long double string_to_Double(const std::string& input);
bool doubleOverflow(const long double& x, const long double& y);
int split(const std::string &s, char delim, std::vector<std::string> &elems);
void buildPacket(char* packet, std::string command);
bool sendPacket(long int &csock, void* packet);
bool listenPacket(long int &csock, char* packet);
bool isDouble(std::string questionable_string);
bool encryptPacket(char* packet, byte* aes_key);
bool decryptPacket(char* packet, byte* aes_key);
void generateRandomKey(std::string name, byte* key, long unsigned int length);
#endif