{"id":7887,"date":"2021-05-24T12:35:59","date_gmt":"2021-05-24T17:35:59","guid":{"rendered":"https:\/\/www.rushworth.us\/lisa\/?p=7887"},"modified":"2021-05-27T13:25:51","modified_gmt":"2021-05-27T18:25:51","slug":"on-uuids","status":"publish","type":"post","link":"https:\/\/www.rushworth.us\/lisa\/?p=7887","title":{"rendered":"On UUIDs"},"content":{"rendered":"<p><a href=\"https:\/\/datatracker.ietf.org\/doc\/html\/rfc4122\" target=\"_blank\" rel=\"noopener\">RFC 4122<\/a> UUID Versions:<\/p>\n<p>1 &#8212; Datetime and MAC based<br \/>\n48-bit MAC address, 60-bit timestamp, 13-14 bit uniquifying sequence<\/p>\n<p>2 &#8212; Datetime and MAC based with DCE security<br \/>\n8 least significant clock sequence numbers and least significant 32 bits of timestamp. RFC doesn&#8217;t reallly provide details on DCE security<\/p>\n<p>3 &#8212; Hashed Namespace<br \/>\nMD5 hash of namespace<\/p>\n<p>4 &#8212; Random<br \/>\n6 pre-determined bits (4 bits for version, 2-3 bits for variant 1 or 2) and 122 bits for 2^122 possible v4 variant 1 UUIDs<\/p>\n<p>5 &#8212; Hashed Namespace<br \/>\nSHA-1 hash of namespace<\/p>\n<p>In my case, I hesitate to use a v1 or v2 UUID because I have scripts executing in cron on the same host. The probability of the function being called at the same microsecond time seems higher than the pseudo-random number generator popping the same value in the handful of hours for which the UUIDs will be persisted for deduplication.<\/p>\n<p>v3 or v5 UUIDs are my fallback position if we&#8217;re seeing dups in v4 &#8212; the namespace would need to glom together the script name and microsecond time to make a unique string when multiple scripts are running the function concurrently.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>RFC 4122 UUID Versions: 1 &#8212; Datetime and MAC based 48-bit MAC address, 60-bit timestamp, 13-14 bit uniquifying sequence 2 &#8212; Datetime and MAC based with DCE security 8 least significant clock sequence numbers and least significant 32 bits of timestamp. RFC doesn&#8217;t reallly provide details on DCE security 3 &#8212; Hashed Namespace MD5 hash &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[33],"tags":[1371,664,1372,1370],"class_list":["post-7887","post","type-post","status-publish","format-standard","hentry","category-coding","tag-guid","tag-python","tag-unique-id","tag-uuid"],"_links":{"self":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/7887","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=7887"}],"version-history":[{"count":3,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/7887\/revisions"}],"predecessor-version":[{"id":7890,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/7887\/revisions\/7890"}],"wp:attachment":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=7887"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=7887"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=7887"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}