X-Git-Url: https://pd.if.org/git/?p=uuid;a=blobdiff_plain;f=internal.c;h=597dc7417ad2e1203073d2a756515391e1789ca2;hp=c9a72f6da25eefc10d23d75bcb3697fb9175b9a0;hb=4af7c34e1c9a4f379decfe3583590f3e8c16892f;hpb=2cf15043eba6ed7b16526145dcf6a2b563b9712d diff --git a/internal.c b/internal.c index c9a72f6..597dc74 100644 --- a/internal.c +++ b/internal.c @@ -489,7 +489,9 @@ int pd_uuid_make_v5(struct pd_uuid_state *s, pd_uuid_t *uuid, pd_uuid_t *ns, voi } /* - * s must point to enough space + * s must point to enough space, i.e. at least 37 bytes. + * this is constrained enough that sprintf could + * probably be avoided */ char *pd_uuid_get_string(pd_uuid_t *uuid, char *s) { char *r; @@ -508,6 +510,11 @@ char *pd_uuid_get_string(pd_uuid_t *uuid, char *s) { return s; } +/* + * might be faster to sscanf in four bytes at a time + * and using htonl() + * A nybble loop might be faster yet. + */ int pd_uuid_set_string(pd_uuid_t *uuid, char *s) { unsigned int byte; int i;