How I can avoid strict aliasing rule violation, trying to modify char*
result of sha256 function.
Compute hash value:
std::string sha = sha256("some text");
const char* sha_result = sha.c_str();
unsigned long* mod_args = reinterpret_cast<unsigned long*>(sha_result);
than getting 2 pieces of 64 bit:
unsigned long a = mod_args[1] ^ mod_args[3] ^ mod_args[5] ^ mod_args[7];
unsigned long b = mod_args[0] ^ mod_args[2] ^ mod_args[4] ^ mod_args[6];
than getting result by concat that two pieces:
unsigned long long result = (((unsigned long long)a) << 32) | b;