\doxysection{Utility.\+h}
\hypertarget{a00443_source}{}\label{a00443_source}\index{Utility.h@{Utility.h}}

\begin{DoxyCode}{0}
\DoxyCodeLine{00001\ \textcolor{preprocessor}{\#pragma\ once}}
\DoxyCodeLine{00002\ \textcolor{preprocessor}{\#include\ <string>}}
\DoxyCodeLine{00003\ \textcolor{preprocessor}{\#include\ <vector>}}
\DoxyCodeLine{00004\ \textcolor{preprocessor}{\#ifdef\ STARFLEETTOOLBOX\_EXPORTS}}
\DoxyCodeLine{00005\ \textcolor{preprocessor}{\#define\ UTILS\ \_\_declspec(dllexport)}}
\DoxyCodeLine{00006\ \textcolor{preprocessor}{\#else}}
\DoxyCodeLine{00007\ \textcolor{preprocessor}{\#define\ UTILS\ \_\_declspec(dllimport)}}
\DoxyCodeLine{00008\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{00009\ }
\DoxyCodeLine{00010\ }
\DoxyCodeLine{00011\ \textcolor{keyword}{using\ namespace\ }std;}
\DoxyCodeLine{00012\ }
\DoxyCodeLine{00013\ \textcolor{preprocessor}{\#define\ MILLIMETERS\ 0}}
\DoxyCodeLine{00014\ \textcolor{preprocessor}{\#define\ INCHES\ 1}}
\DoxyCodeLine{00015\ \textcolor{preprocessor}{\#define\ CHALLENGE\_AND\_KEY\_SIZE\ 20\ \ \ \ \ }}
\DoxyCodeLine{00016\ \textcolor{keyword}{static}\ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ BASIC\_OBFUSCATED\_PRIVATE\_KEY[]\ =\ \{}
\DoxyCodeLine{00017\ \ \ \ \ \textcolor{charliteral}{'U'}\ \string^\ 0xCE,\ \textcolor{charliteral}{'z'}\ \string^\ 0xCE,\ \textcolor{charliteral}{'\$'}\ \string^\ 0xCE,\ \textcolor{charliteral}{'5'}\ \string^\ 0xCE,\ \textcolor{charliteral}{'T'}\ \string^\ 0xCE,}
\DoxyCodeLine{00018\ \ \ \ \ \textcolor{charliteral}{'2'}\ \string^\ 0xCE,\ \textcolor{charliteral}{'*'}\ \string^\ 0xCE,\ \textcolor{charliteral}{'G'}\ \string^\ 0xCE,\ \textcolor{charliteral}{'0'}\ \string^\ 0xCE,\ \textcolor{charliteral}{'M'}\ \string^\ 0xCE,}
\DoxyCodeLine{00019\ \ \ \ \ \textcolor{charliteral}{'7'}\ \string^\ 0xCE,\ \textcolor{charliteral}{'q'}\ \string^\ 0xCE,\ \textcolor{charliteral}{'9'}\ \string^\ 0xCE,\ \textcolor{charliteral}{'l'}\ \string^\ 0xCE,\ \textcolor{charliteral}{'\&'}\ \string^\ 0xCE,}
\DoxyCodeLine{00020\ \ \ \ \ \textcolor{charliteral}{'O'}\ \string^\ 0xCE,\ \textcolor{charliteral}{'t'}\ \string^\ 0xCE,\ \textcolor{charliteral}{'r'}\ \string^\ 0xCE,\ \textcolor{charliteral}{'\_'}\ \string^\ 0xCE,\ \textcolor{charliteral}{'k'}\ \string^\ 0xCE,\ \textcolor{charliteral}{'\(\backslash\)0'}\ \};\ \ \textcolor{comment}{//\ The\ key\ is\ obfuscated}}
\DoxyCodeLine{00021\ }
\DoxyCodeLine{00022\ \textcolor{keyword}{typedef}\ \textcolor{keywordtype}{int}\ MEASURMENT\_UNIT;}
\DoxyCodeLine{00023\ }
\DoxyCodeLine{00027\ \textcolor{keyword}{class\ }UTILS\ \mbox{\hyperlink{a00920}{Utility}}}
\DoxyCodeLine{00028\ \{}
\DoxyCodeLine{00029\ \textcolor{keyword}{public}:\ }
\DoxyCodeLine{00035\ \ \ \ \ \textcolor{keyword}{static}\ \textcolor{keywordtype}{double}\ ToInches(\textcolor{keywordtype}{double}\ metricMilimeters);}
\DoxyCodeLine{00036\ }
\DoxyCodeLine{00042\ \ \ \ \ \textcolor{keyword}{static}\ \textcolor{keywordtype}{double}\ ToMilimeters(\textcolor{keywordtype}{double}\ imperialInches);}
\DoxyCodeLine{00043\ }
\DoxyCodeLine{00049\ \ \ \ \ \textcolor{keyword}{static}\ int16\_t\ be16\_to\_cpu\_signed(\textcolor{keywordtype}{string}\ recvBuffer);}
\DoxyCodeLine{00050\ }
\DoxyCodeLine{00056\ \ \ \ \ \textcolor{keyword}{static}\ int16\_t\ be16\_to\_cpu\_signed(\textcolor{keywordtype}{char}\ recvChar);}
\DoxyCodeLine{00057\ }
\DoxyCodeLine{00064\ \ \ \ \ \textcolor{keyword}{static}\ int16\_t\ be16\_to\_cpu\_signed(\textcolor{keywordtype}{char}\ high,\ \textcolor{keywordtype}{char}\ low);}
\DoxyCodeLine{00065\ }
\DoxyCodeLine{00071\ \ \ \ \ \textcolor{keyword}{static}\ uint16\_t\ be16\_to\_cpu\_unsigned(\textcolor{keywordtype}{string}\ recvBuffer);}
\DoxyCodeLine{00072\ }
\DoxyCodeLine{00078\ \ \ \ \ \textcolor{keyword}{static}\ uint16\_t\ be16\_to\_cpu\_unsigned(\textcolor{keywordtype}{char}\ recvChar);}
\DoxyCodeLine{00079\ }
\DoxyCodeLine{00086\ \ \ \ \ \textcolor{keyword}{static}\ uint16\_t\ be16\_to\_cpu\_unsigned(\textcolor{keywordtype}{char}\ high,\ \textcolor{keywordtype}{char}\ low);}
\DoxyCodeLine{00087\ }
\DoxyCodeLine{00095\ \ \ \ \ \textcolor{keyword}{static}\ \textcolor{keywordtype}{string}\ ReplaceAll(\textcolor{keywordtype}{string}\ str,\ \textcolor{keyword}{const}\ \textcolor{keywordtype}{string}\&\ from,\ \textcolor{keyword}{const}\ \textcolor{keywordtype}{string}\&\ to);}
\DoxyCodeLine{00096\ }
\DoxyCodeLine{00103\ \ \ \ \ \textcolor{keyword}{static}\ vector<string>\ Split(\textcolor{keywordtype}{string}\ toSplit,\ \textcolor{keywordtype}{string}\ delimiter);}
\DoxyCodeLine{00104\ }
\DoxyCodeLine{00110\ \ \ \ \ \textcolor{keyword}{static}\ \textcolor{keywordtype}{string}\ ConvertToHexRepresentation8(int8\_t\ toConvert);}
\DoxyCodeLine{00111\ }
\DoxyCodeLine{00117\ \ \ \ \ \textcolor{keyword}{static}\ \textcolor{keywordtype}{string}\ ConvertToHexRepresentation16(int16\_t\ toConvert);}
\DoxyCodeLine{00118\ }
\DoxyCodeLine{00124\ \ \ \ \ \textcolor{keyword}{static}\ \textcolor{keywordtype}{string}\ ConvertToHexRepresentation32(int32\_t\ toConvert);}
\DoxyCodeLine{00125\ }
\DoxyCodeLine{00131\ \ \ \ \ \textcolor{keyword}{static}\ \textcolor{keywordtype}{string}\ ConvertToHexRepresentation64(int64\_t\ toConvert);}
\DoxyCodeLine{00132\ }
\DoxyCodeLine{00138\ \ \ \ \ \textcolor{keyword}{static}\ int8\_t\ ConvertHexTo8Bit(\textcolor{keywordtype}{char}*\ toConvert);}
\DoxyCodeLine{00139\ }
\DoxyCodeLine{00145\ \ \ \ \ \textcolor{keyword}{static}\ int16\_t\ ConvertHexTo16Bit(\textcolor{keywordtype}{char}*\ toConvert);\ \ }
\DoxyCodeLine{00146\ }
\DoxyCodeLine{00152\ \ \ \ \ \textcolor{keyword}{static}\ int32\_t\ ConvertHexTo32Bit(\textcolor{keywordtype}{char}*\ toConvert);}
\DoxyCodeLine{00153\ }
\DoxyCodeLine{00159\ \ \ \ \ \textcolor{keyword}{static}\ int64\_t\ ConvertHexTo64Bit(\textcolor{keywordtype}{char}*\ toConvert);}
\DoxyCodeLine{00160\ }
\DoxyCodeLine{00166\ \ \ \ \ \textcolor{keyword}{static}\ uint8\_t\ ConvertHexToUnsigned8Bit(\textcolor{keywordtype}{char}*\ toConvert);}
\DoxyCodeLine{00167\ }
\DoxyCodeLine{00173\ \ \ \ \ \textcolor{keyword}{static}\ uint16\_t\ ConvertHexToUnsigned16Bit(\textcolor{keywordtype}{char}*\ toConvert);}
\DoxyCodeLine{00174\ }
\DoxyCodeLine{00180\ \ \ \ \ \textcolor{keyword}{static}\ uint32\_t\ ConvertHexToUnsigned32Bit(\textcolor{keywordtype}{char}*\ toConvert);}
\DoxyCodeLine{00181\ }
\DoxyCodeLine{00187\ \ \ \ \ \textcolor{keyword}{static}\ uint64\_t\ ConvertHexToUnsigned64Bit(\textcolor{keywordtype}{char}*\ toConvert);}
\DoxyCodeLine{00188\ }
\DoxyCodeLine{00194\ \ \ \ \ \textcolor{keyword}{static}\ \textcolor{keywordtype}{string}\ ExtractIpModel(\textcolor{keyword}{const}\ \textcolor{keywordtype}{char}*\ toFormat);}
\DoxyCodeLine{00195\ }
\DoxyCodeLine{00201\ \ \ \ \ \textcolor{keyword}{static}\ \textcolor{keywordtype}{string}\ ExtractMacModel(\textcolor{keyword}{const}\ \textcolor{keywordtype}{char}*\ toFormat);}
\DoxyCodeLine{00202\ }
\DoxyCodeLine{00208\ \ \ \ \ \textcolor{keyword}{static}\ \textcolor{keywordtype}{string}\ \ RemoveTrailingZeros(std::string\ toClean);}
\DoxyCodeLine{00209\ }
\DoxyCodeLine{00210\ \ \ \ \ }
\DoxyCodeLine{00217\ }
\DoxyCodeLine{00219\ \ \ \ \ \textcolor{keyword}{static}\ \textcolor{keywordtype}{void}\ ComputeCypher(\textcolor{keywordtype}{char}*\ challenge,\ \textcolor{keywordtype}{unsigned}\ \textcolor{keywordtype}{char}*\ cypher);}
\DoxyCodeLine{00221\ }
\DoxyCodeLine{00222\ \ \ \ \ \ }
\DoxyCodeLine{00231\ \ \ \ \ }
\DoxyCodeLine{00233\ \ \ \ \ \textcolor{keyword}{static}\ \textcolor{keywordtype}{void}\ ReorderPrivateKeyAndRemoveObfuscation(\textcolor{keywordtype}{char}*\ originalKey,\ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}*\ challenge,\ \textcolor{keywordtype}{char}*\ newPrivateKey);}
\DoxyCodeLine{00235\ \};}
\DoxyCodeLine{00236\ }

\end{DoxyCode}
