MCPcopy Create free account
hub / github.com/apache/singa / getHostHash

Function getHostHash

src/io/communicator.cc:30–37  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28namespace singa {
29
30static uint64_t getHostHash(const char *string) {
31 // Based on DJB2, result = result * 33 + char
32 uint64_t result = 5381;
33 for (int c = 0; string[c] != '\0'; c++) {
34 result = ((result << 5) + result) + string[c];
35 }
36 return result;
37}
38
39static void getHostName(char *hostname, int maxlen) {
40 gethostname(hostname, maxlen);

Callers 1

CommunicatorMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected