41 size_t hexStringToByteArray(
const std::string& hexString, uint8_t* resultByteArr,
size_t resultByteArrSize);
59 template <
int alignment>
static int align(
int number)
62 constexpr
bool isPowerOfTwo = alignment && ((alignment & (alignment - 1)) == 0);
63 static_assert(isPowerOfTwo,
"Alignment must be a power of 2");
64 int mask = alignment - 1;
65 return (number + mask) & ~mask;
72 template <typename EnumClass, typename std::enable_if<std::is_enum<EnumClass>::value,
bool>::type =
false>
75 size_t operator()(EnumClass value)
const
77 return static_cast<typename std::underlying_type<EnumClass>::type
>(value);
The main namespace for the PcapPlusPlus lib.
char * cross_platform_memmem(const char *haystack, size_t haystackLen, const char *needle, size_t needleLen)
std::string byteArrayToHexString(const uint8_t *byteArr, size_t byteArrSize, int stringSizeLimit=-1)
size_t hexStringToByteArray(const std::string &hexString, uint8_t *resultByteArr, size_t resultByteArrSize)
Definition: GeneralUtils.h:74