| LicenseSpring C++ SDK 7.32.0 Easily add Software Licensing to your application

Loading...
Searching...
No Matches
Classes | Namespaces | Macros | Functions | Variables
EncryptString.h File Reference
`#include <iostream>`

Go to the source code of this file.

## Classes
class | LicenseSpring::Xor_string< size, Char >

## Namespaces
namespace | LicenseSpring

## Macros
#define | TBX_XSTR_SEED
#define | Random_LCG() linear_congruent_generator(10)
#define | XSTR_RANDOM_NUMBER(Min, Max) (Min + (Random_LCG() % (Max - Min + 1)))
#define | XorS(name, my_string) constexpr LicenseSpring::Xor_string<(sizeof(my_string)/sizeof(char)), char> name(my_string)
#define | XorString(my_string) []{ constexpr LicenseSpring::Xor_string<(sizeof(my_string)/sizeof(char)), char> expr(my_string); return expr; }().decrypt()
#define | XorWS(name, my_string) constexpr LicenseSpring::Xor_string<(sizeof(my_string)/sizeof(wchar_t)), wchar_t> name(my_string)
#define | XorWideString(my_string) []{ constexpr LicenseSpring::Xor_string<(sizeof(my_string)/sizeof(wchar_t)), wchar_t> expr(my_string); return expr; }().decrypt()
#define | EncryptStr(s) XorString(s)
| Encrypts c-string at compile time.
#define | EncryptWStr(s) XorWideString(s)
| Encrypts wide (wchar_t) string at compile time.

## Functions
constexpr unsigned long long | LicenseSpring::linear_congruent_generator (unsigned rounds)
template<typename Char >
constexpr Char | LicenseSpring::encrypt_character (const Char character, int index)

## Variables
constexpr const unsigned long long | LicenseSpring::XORKEY = XSTR_RANDOM_NUMBER(0, 0xFF)

## Macro Definition Documentation

## ◆ TBX_XSTR_SEED

#define TBX_XSTR_SEED

Value:
((__TIME__[7] - '0') * 1ull + (__TIME__[6] - '0') * 10ull + \
(__TIME__[4] - '0') * 60ull + (__TIME__[3] - '0') * 600ull + \
(__TIME__[1] - '0') * 3600ull + (__TIME__[0] - '0') * 36000ull)

Definition at line 17 of file EncryptString.h.

## ◆ Random_LCG

#define Random_LCG | ( |  | ) | linear_congruent_generator(10)

Definition at line 35 of file EncryptString.h.

## ◆ XSTR_RANDOM_NUMBER

#define XSTR_RANDOM_NUMBER | ( |  | Min,
|  |  | Max
| ) |  | (Min + (Random_LCG() % (Max - Min + 1)))

Definition at line 36 of file EncryptString.h.

## ◆ XorS

#define XorS | ( |  | name,
|  |  | my_string
| ) |  | constexpr LicenseSpring::Xor_string<(sizeof(my_string)/sizeof(char)), char> name(my_string)

Definition at line 79 of file EncryptString.h.

## ◆ XorString

#define XorString | ( |  | my_string | ) | []{ constexpr LicenseSpring::Xor_string<(sizeof(my_string)/sizeof(char)), char> expr(my_string); return expr; }().decrypt()

Definition at line 80 of file EncryptString.h.

## ◆ XorWS

#define XorWS | ( |  | name,
|  |  | my_string
| ) |  | constexpr LicenseSpring::Xor_string<(sizeof(my_string)/sizeof(wchar_t)), wchar_t> name(my_string)

Definition at line 82 of file EncryptString.h.

## ◆ XorWideString

#define XorWideString | ( |  | my_string | ) | []{ constexpr LicenseSpring::Xor_string<(sizeof(my_string)/sizeof(wchar_t)), wchar_t> expr(my_string); return expr; }().decrypt()

Definition at line 83 of file EncryptString.h.

## ◆ EncryptStr

#define EncryptStr | ( |  | s | ) | XorString(s)

Encrypts c-string at compile time.

Please note this macro does not work for global (static) strings This feature may require C++14. In order to enable C++14 in the Xcode navigate to Targets->MyTarget->Build Settings->Apple Clang - Language - C++ -> C++ Language Dialect and set GNU++14 or C++14.

Parameters

  s | input string.

Returns
  Decrypted string at runtime.

Definition at line 92 of file EncryptString.h.

## ◆ EncryptWStr

#define EncryptWStr | ( |  | s | ) | XorWideString(s)

Encrypts wide (wchar_t) string at compile time.

Please note this macro does not work for global (static) strings This feature may require C++14. In order to enable C++14 in the Xcode navigate to Targets->MyTarget->Build Settings->Apple Clang - Language - C++ -> C++ Language Dialect and set GNU++14 or C++14.

Parameters

  s | input string.

Returns
  Decrypted string at runtime.

Definition at line 101 of file EncryptString.h.