{"id":167,"date":"2011-04-27T21:31:18","date_gmt":"2011-04-27T21:31:18","guid":{"rendered":"http:\/\/shivdev.com\/blog\/?p=167"},"modified":"2011-04-27T21:34:41","modified_gmt":"2011-04-27T21:34:41","slug":"generate-a-uuid-in-java","status":"publish","type":"post","link":"http:\/\/shivdev.com\/blog\/2011\/04\/27\/generate-a-uuid-in-java\/","title":{"rendered":"Generate a UUID in Java"},"content":{"rendered":"<p>Folks, look no further. <strong>java.util.UUID<\/strong> works great. I&#8217;ve tried the Axis&#8217;s UUIDGenFactory and and was NOT unique. 10 reps of 40 threads pounding simultaneously. At least, two or three of the forty were duplicates every time (only thirty seven were unique) Geeze!!! And I thought it was the synchronization.<\/p>\n<blockquote><p><strong>java.util.UUID.randomUUID().toString();<\/strong> \/\/ This works<\/p><\/blockquote>\n<p>Moreover, it uses SecureRandom number generator algorithms &#8211; so it is secure (in terms of predicting the next UUID etc.).<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Folks, look no further. java.util.UUID works great. I&#8217;ve tried the Axis&#8217;s UUIDGenFactory and and was NOT unique. 10 reps of 40 threads pounding simultaneously. At least, two or three of the forty were duplicates every time (only thirty seven were unique) Geeze!!! And I thought it was the synchronization. java.util.UUID.randomUUID().toString(); \/\/ This works Moreover, it [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[11],"tags":[],"_links":{"self":[{"href":"http:\/\/shivdev.com\/blog\/wp-json\/wp\/v2\/posts\/167"}],"collection":[{"href":"http:\/\/shivdev.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/shivdev.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/shivdev.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/shivdev.com\/blog\/wp-json\/wp\/v2\/comments?post=167"}],"version-history":[{"count":3,"href":"http:\/\/shivdev.com\/blog\/wp-json\/wp\/v2\/posts\/167\/revisions"}],"predecessor-version":[{"id":169,"href":"http:\/\/shivdev.com\/blog\/wp-json\/wp\/v2\/posts\/167\/revisions\/169"}],"wp:attachment":[{"href":"http:\/\/shivdev.com\/blog\/wp-json\/wp\/v2\/media?parent=167"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/shivdev.com\/blog\/wp-json\/wp\/v2\/categories?post=167"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/shivdev.com\/blog\/wp-json\/wp\/v2\/tags?post=167"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}