uuid

uuid

Synopsis

#include <midgard/midgard.h>

gboolean            midgard_is_uuid                     (const gchar *uuid);
gchar *             midgard_uuid_new                    (void);
gchar *             midgard_uuid_external               (const gchar *external);

Description

This is a simple implementation of the RFC 4122 type 1 and type 3 UUIDs used as Midgard Globally Unique Identifiers (GUIDs).

Type 1 UUIDs are generated using a random per-process node identifier. This makes the generated UUIDs a bit less unique, but remove the need for persistent state and inter-process synchronization.

Type 3 UUIDs are generated using the special Midgard namespace UUID \c 00dc46a0-0e0c-1085-82bb-0002a5d5fd2e as the namespace.

The UUID functions should only be called directly if an explicit UUID is needed. The more general GUID functions should be used for object identifiers and other normal GUIDs. Although the GUID functions normally use the UUID functions internally, they make it possible to specify database-specific GUID generators or constraints.

Details

midgard_is_uuid ()

gboolean            midgard_is_uuid                     (const gchar *uuid);


midgard_uuid_new ()

gchar *             midgard_uuid_new                    (void);


midgard_uuid_external ()

gchar *             midgard_uuid_external               (const gchar *external);