Extending conn_id with a globally unique identifiers.

This commit is contained in:
Robin Sommer 2011-03-15 17:50:30 -07:00
parent 0f854315e9
commit 881071cc99
6 changed files with 73 additions and 4 deletions

View file

@ -340,6 +340,26 @@ int atoi_n(int len, const char* s, const char** end, int base, int& result)
return 1;
}
char* uitoa_n(uint64 value, char* str, int n, int base)
{
static char dig[] = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
int i = 0;
uint64 v;
char* p, *q;
char c;
v = value;
do {
str[i++] = dig[v % base];
v /= base;
} while ( v && i < n );
str[i] = '\0';
return str;
}
int strstr_n(const int big_len, const u_char* big,
const int little_len, const u_char* little)
{