2 * test program for uuid library
4 * written by nathan wagner and placed in the public domain
12 void ufmt(pd_uuid_t *uuid, char *s) {
15 s += sprintf(s, "%02x", uuid->data[i]);
19 s += sprintf(s, "%02x", uuid->data[i]);
23 s += sprintf(s, "%02x", uuid->data[i]);
27 s += sprintf(s, "%02x", uuid->data[i]);
31 s += sprintf(s, "%02x", uuid->data[i]);
35 int main(int ac, char *av[]) {
46 pd_uuid_make_v1(0, &uuid);
48 printf("v1: %s\n", fmt);
50 pd_uuid_make_v4(0, &uuid);
52 printf("v4: %s\n", fmt);
54 pd_uuid_set_string(&dns, "6ba7b810-9dad-11d1-80b4-00c04fd430c8");
56 printf("dns: %s\n", fmt);
58 pd_uuid_make_v3(0, &uuid, &dns, "granicus.if.org", strlen("granicus.if.org"));
60 printf("granicus.if.org (v3): %s\n", fmt);
62 pd_uuid_make_v5(0, &uuid, &dns, "granicus.if.org", strlen("granicus.if.org"));
64 printf("granicus.if.org (v5): %s\n", fmt);