Skip to content

Latest commit

 

History

History
24 lines (20 loc) · 966 Bytes

README.md

File metadata and controls

24 lines (20 loc) · 966 Bytes

Build Status Coverage Status license

ctstring

Compile-Time String

Strings at compile-time

Strings can be used for anything at compile-time, e.g. for hash calculation or matching:

auto sample1 = "Hello"_chars;
auto sample2 = "Hello"_ichars;
char constexpr csz[] = "hello world";
static_assert(!sample1.match(csz, csz+sizeof(csz)), "");
static_assert(sample2.match(csz, csz+sizeof(csz)), "");

Obfuscated strings

Obfuscate strings in compiled binary to hide sensitive data:

auto const xsHidden = "Farewell: this won't be seen in binary!"_xchars;
std::cout << "hidden: " << xsHidden.str().c_str() << std::endl;