guid.c revision de62ce819d59a529530da4b57be1b8d6dad13d6b
/* Copyright (c) 2011 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "buffer.h"
#include "crc32.h"
#include "hash.h"
#include "hex-binary.h"
#include "hostpid.h"
#include "guid.h"
#include <unistd.h>
#include <time.h>
const char *guid_generate(void)
{
static unsigned int pid = 0;
/* we'll use the current time in nanoseconds as the initial 64bit
counter. */
i_fatal("clock_gettime() failed: %m");
} else {
}
return t_strdup_printf("%04x%04lx%04x%s",
pid, my_hostname);
}
{
/* we'll use the current time in nanoseconds as the initial 64bit
counter. */
i_fatal("clock_gettime() failed: %m");
} else {
}
}
{
unsigned int i;
for (i = 0; i < GUID_128_SIZE; i++) {
if (guid[i] != 0)
return FALSE;
}
return TRUE;
}
{
}
{
}
unsigned int guid_128_hash(const void *p)
{
}
{
}