summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/uuid.c8
-rw-r--r--lib/uuid.h1
2 files changed, 9 insertions, 0 deletions
diff --git a/lib/uuid.c b/lib/uuid.c
index 06f879259..13d20ac64 100644
--- a/lib/uuid.c
+++ b/lib/uuid.c
@@ -101,6 +101,14 @@ uuid_generate(struct uuid *uuid)
uuid_set_bits_v4(uuid);
}
+struct uuid
+uuid_random(void)
+{
+ struct uuid uuid;
+ uuid_generate(&uuid);
+ return uuid;
+}
+
void
uuid_set_bits_v4(struct uuid *uuid)
{
diff --git a/lib/uuid.h b/lib/uuid.h
index 10bc8b541..dba6e1c11 100644
--- a/lib/uuid.h
+++ b/lib/uuid.h
@@ -59,6 +59,7 @@ uuid_equals(const struct uuid *a, const struct uuid *b)
void uuid_init(void);
void uuid_generate(struct uuid *);
+struct uuid uuid_random(void);
void uuid_zero(struct uuid *);
bool uuid_is_zero(const struct uuid *);
int uuid_compare_3way(const struct uuid *, const struct uuid *);