MCPcopy Create free account
hub / github.com/Tencent/phxsql / GetSvrID

Method GetSvrID

phxcomm/utils/phx_utils.cpp:35–42  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33}
34
35uint32_t Utils::GetSvrID(const string &ip) {
36 uint32_t svrid = 0;
37 uint32_t tmp[4] = { 0 };
38
39 sscanf(ip.c_str(), "%u.%u.%u.%u", &tmp[3], &tmp[2], &tmp[1], &tmp[0]);
40 svrid = (tmp[3] << 24) | (tmp[2] << 16) | (tmp[1] << 8) | tmp[0];
41 return svrid;
42}
43
44uint64_t Utils::GetCheckSum(const uint64_t &old_checksum, const char *value, const size_t &value_size) {
45 uint64_t checksum = old_checksum;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected