Closed enaenen closed 1 year ago
/ for hashfuncs/
std::string makehash(int& fd) {
std::time_t t = std::time(0);
uint32_t hash_key = t;
uint32_t seed = fd % 64;
std::bitset<64> b(hash_key);
std::bitset<32> a(hash_key);
b <<= 32;
a <<= fd;
std::string table_left = "0A1B2C3D4E5F6G7H8I9JaKbLcMdNeOf+";
std::string table_right = "PgQhRiSjTkUlVmWnXoYpZqvrwsxtyuz-";
std::string hash_str;
int i = 31;
while (i >= 0) {
if (b.test(i)) {
hash_str += table_left[i];
} else {
hash_str += table_left[31 - i];
}
if (a.test(i)) {
hash_str += table_right[i];
} else {
hash_str += table_right[31 - i];
}
--i;
}
return hash_str;
}
*cookie & session 처리
Session값 이 이미 있을 경우
Session값이 없을경우
태스크