MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / stringCheckPrefix

Function stringCheckPrefix

src/tracking.cpp:102–105  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

100}
101
102static int stringCheckPrefix(unsigned char *s1, size_t s1_len, unsigned char *s2, size_t s2_len) {
103 size_t min_length = s1_len < s2_len ? s1_len : s2_len;
104 return memcmp(s1,s2,min_length) == 0;
105}
106
107/* Check if any of the provided prefixes collide with one another or
108 * with an existing prefix for the client. A collision is defined as two

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected