From 5e141e336c3a2cb8921edcd7af6f14a29ff63942 Mon Sep 17 00:00:00 2001 From: bigfoot547 Date: Wed, 27 Dec 2023 06:51:29 -0600 Subject: add cheap SHA1 implementation --- src/uuid/uuid.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/uuid/uuid.c') diff --git a/src/uuid/uuid.c b/src/uuid/uuid.c index 0dfcfbd..e1498fc 100644 --- a/src/uuid/uuid.c +++ b/src/uuid/uuid.c @@ -74,7 +74,7 @@ bool l2_uuid_from_string_short(uuid_t *id, const char *str) if (!l2__str_to_uint64(outid.halves + 1, str)) return false; if (!l2__str_to_uint64(outid.halves, str + 16)) return false; - memcpy(id, &outid, sizeof(uuid_t)); + l2_uuid_copy(id, &outid); return true; } @@ -83,6 +83,10 @@ int l2_uuid_compare(const uuid_t *c1, const uuid_t *c2) return memcmp(c1, c2, sizeof(uuid_t)); } +void l2_uuid_copy(uuid_t *restrict dest, const uuid_t *restrict in) { + memcpy(dest, in, sizeof(uuid_t)); +} + /* This function exists because there's not a portable way to do this. * Don't suggest strtoull, because uint64_t may not be a ulonglong. */ bool l2__str_to_uint64(uint64_t *out, const char *str) -- cgit v1.2.3-70-g09d2