| Visioscan Set SDK Libraries 1.0.28 Visioscan Set SDK Help documentation file for C++ and C++/CLI |

Loading...
Searching...
No Matches
Utility.h
1#pragma once
2#include <string>
3#include <vector>
4#ifdef STARFLEETTOOLBOX_EXPORTS
5#define UTILS __declspec(dllexport)
6#else
7#define UTILS __declspec(dllimport)
8#endif
9
10
11 using namespace std;
12
13#define MILLIMETERS 0
14#define INCHES 1
15#define CHALLENGE_AND_KEY_SIZE 20
16 static const char BASIC_OBFUSCATED_PRIVATE_KEY[] = {
17 'U' ^ 0xCE, 'z' ^ 0xCE, '$' ^ 0xCE, '5' ^ 0xCE, 'T' ^ 0xCE,
18 '2' ^ 0xCE, '*' ^ 0xCE, 'G' ^ 0xCE, '0' ^ 0xCE, 'M' ^ 0xCE,
19 '7' ^ 0xCE, 'q' ^ 0xCE, '9' ^ 0xCE, 'l' ^ 0xCE, '&' ^ 0xCE,
20 'O' ^ 0xCE, 't' ^ 0xCE, 'r' ^ 0xCE, '_' ^ 0xCE, 'k' ^ 0xCE, '\0' }; // The key is obfuscated
21
22 typedef int MEASURMENT_UNIT;
23
27 class UTILS Utility
28{
29 public:
35 static double ToInches(double metricMilimeters);
36
42 static double ToMilimeters(double imperialInches);
43
49 static int16_t be16_to_cpu_signed(string recvBuffer);
50
56 static int16_t be16_to_cpu_signed(char recvChar);
57
64 static int16_t be16_to_cpu_signed(char high, char low);
65
71 static uint16_t be16_to_cpu_unsigned(string recvBuffer);
72
78 static uint16_t be16_to_cpu_unsigned(char recvChar);
79
86 static uint16_t be16_to_cpu_unsigned(char high, char low);
87
95 static string ReplaceAll(string str, const string& from, const string& to);
96
103 static vector<string> Split(string toSplit, string delimiter);
104
110 static string ConvertToHexRepresentation8(int8_t toConvert);
111
117 static string ConvertToHexRepresentation16(int16_t toConvert);
118
124 static string ConvertToHexRepresentation32(int32_t toConvert);
125
131 static string ConvertToHexRepresentation64(int64_t toConvert);
132
138 static int8_t ConvertHexTo8Bit(char* toConvert);
139
145 static int16_t ConvertHexTo16Bit(char* toConvert);
146
152 static int32_t ConvertHexTo32Bit(char* toConvert);
153
159 static int64_t ConvertHexTo64Bit(char* toConvert);
160
166 static uint8_t ConvertHexToUnsigned8Bit(char* toConvert);
167
173 static uint16_t ConvertHexToUnsigned16Bit(char* toConvert);
174
180 static uint32_t ConvertHexToUnsigned32Bit(char* toConvert);
181
187 static uint64_t ConvertHexToUnsigned64Bit(char* toConvert);
188
194 static string ExtractIpModel(const char* toFormat);
195
201 static string ExtractMacModel(const char* toFormat);
202
208 static string RemoveTrailingZeros(std::string toClean);
209
210
217
219 static void ComputeCypher(char* challenge, unsigned char* cypher);
221
222
231
233 static void ReorderPrivateKeyAndRemoveObfuscation(char* originalKey, const char* challenge, char* newPrivateKey);
235};
236
Utility
Common utility class.
Definition Utility.h:28