<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>GUIDs are globally unique, but substrings of GUIDs aren't</title><link>http://blogs.msdn.com/oldnewthing/archive/2008/06/27/8659071.aspx</link><description>Half of a GUID is worse than none.</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>re: GUIDs are globally unique, but substrings of GUIDs aren't</title><link>http://blogs.msdn.com/oldnewthing/archive/2008/06/27/8659071.aspx#8661950</link><pubDate>Fri, 27 Jun 2008 18:29:56 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8661950</guid><dc:creator>Adrian</dc:creator><description>&lt;p&gt;Nice analysis.&lt;/p&gt;
&lt;p&gt;I never knew about the algorithm identifier in the GUID. &amp;nbsp;I remember when there was a privacy concern since GUIDs could be tracked back to the machine that generated them (by the network card address). &amp;nbsp;As I understand it, the algorithm used by Windows was changed. &amp;nbsp;It's neat to see that GUIDs generated by different algorithms can't collied.&lt;/p&gt;
</description></item><item><title>re: GUIDs are globally unique, but substrings of GUIDs aren't</title><link>http://blogs.msdn.com/oldnewthing/archive/2008/06/27/8659071.aspx#8661977</link><pubDate>Fri, 27 Jun 2008 18:42:52 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8661977</guid><dc:creator>Joe Enos</dc:creator><description>&lt;p&gt;Wouldn't a truly random GUID generator be better suited? &amp;nbsp;If all 128 bits are random, then you could take a subset of them and still be reasonably unique - not as unique as the full 128, but still pretty good.&lt;/p&gt;
&lt;p&gt;The non-random GUID doesn't really make a lot of sense to me. &amp;nbsp;If truly random, the odds of finding a duplicate are incredibly ridiculously low - if you have it based on a timestamp, network card, etc., you can run into duplicates much easier, especially as CPUs get faster, and as more and more pieces of hardware get added to the global network.&lt;/p&gt;
</description></item><item><title>re: GUIDs are globally unique, but substrings of GUIDs aren't</title><link>http://blogs.msdn.com/oldnewthing/archive/2008/06/27/8659071.aspx#8662043</link><pubDate>Fri, 27 Jun 2008 19:08:49 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8662043</guid><dc:creator>..</dc:creator><description>&lt;p&gt;You basically cannot implement a truly random generator without specific hardware support.&lt;/p&gt;
&lt;p&gt;You can always improve your 128bit UUID adding a random generated number to it (of at least 64bit itself.. remember birthday paradox); adding a second random number to an already random number will not improve the situation that much unless taken from a completely different generator.&lt;/p&gt;
</description></item><item><title>re: GUIDs are globally unique, but substrings of GUIDs aren't</title><link>http://blogs.msdn.com/oldnewthing/archive/2008/06/27/8659071.aspx#8662044</link><pubDate>Fri, 27 Jun 2008 19:09:43 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8662044</guid><dc:creator>Nate</dc:creator><description>&lt;p&gt;Ok, say it with me:&lt;/p&gt;
&lt;p&gt;&amp;quot;GUIDs are not defined to be random; they are defined to BE UNIQUE in space &amp;amp; time!&amp;quot;&lt;/p&gt;
&lt;p&gt;Joe, the customer didn't ask for a random number, they asked for a unique number and more specifically about chopping a GUID in half. &amp;nbsp;Raymond explained why that was a bad idea. And he gave a way to generate a CLUSTER unique number with 0 risk of a collision when taken within the customer specified spatial and temporal domains.&lt;/p&gt;
&lt;p&gt;Also, using a pseudo-random number generator doesn't help with uniqueness if all the computers use the same seed &amp;nbsp;(through the use of time or some other error of coding).&lt;/p&gt;
&lt;p&gt;My $0.02.&lt;/p&gt;
</description></item><item><title>re: GUIDs are globally unique, but substrings of GUIDs aren't</title><link>http://blogs.msdn.com/oldnewthing/archive/2008/06/27/8659071.aspx#8662047</link><pubDate>Fri, 27 Jun 2008 19:11:35 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8662047</guid><dc:creator>Maurits</dc:creator><description>&lt;p&gt;The &amp;quot;random&amp;quot; GUIDs have an &amp;quot;algorithm identifier&amp;quot; of 0100 (4), FWIW.&lt;/p&gt;
&lt;p&gt;Don't get me started on the KSDATAFORMAT_SUBTYPE_PCM and KSDATAFORMAT_SUBTYPE_IEEE_FLOAT pseudo-GUIDs.&lt;/p&gt;
</description></item><item><title>re: GUIDs are globally unique, but substrings of GUIDs aren't</title><link>http://blogs.msdn.com/oldnewthing/archive/2008/06/27/8659071.aspx#8662088</link><pubDate>Fri, 27 Jun 2008 19:26:37 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8662088</guid><dc:creator>Josh</dc:creator><description>&lt;P&gt;@Joe:&lt;/P&gt;
&lt;P&gt;Because there is a *chance* of collision, even with pure randomness. &amp;nbsp;Remember, the birthday problem (aka birthday paradox) means that the time before unacceptably high probability of collision is much lower than the number of possible options. &amp;nbsp;e.g. For truly random 128 bit numbers (3.4e38 options), you'd have a 50% chance of collision after generating about 22 quintillion GUIDs (2.17e19). &amp;nbsp;Problem is, this assumes we are *really* random. &amp;nbsp;And generating numbers that are truly random, to the point of uniqueness, is nearly impossible. &amp;nbsp;For example, one means of generating very good random numbers is having an antenna count ticks in the cosmic background radiation over time. &amp;nbsp;If an odd number of ticks occur in a time frame, you get a 1, even, a 0, continue until the number is long enough. &amp;nbsp;But what if two antennas are generating at the same time in close proximity? &amp;nbsp;Odds of collision increase greatly. &amp;nbsp;And of course, it would take a while to collect the arbitrary randomness. &amp;nbsp;Virtually every form of random number generation would be in some way dependent on the time and location at which it was generated. &amp;nbsp;And any less extensive randomness generator is likely to be slightly non-random, leading to collisions occurring *much* more often.&lt;/P&gt;
&lt;P&gt;The non-random GUID, if you read the description, allows for any given machine to pump out 16 *guaranteed* unique GUIDs per second. &amp;nbsp;And it even manages to conserve 6 bits that aren't part of the uniqueness, to allow for future advances in GUID design. &amp;nbsp;Not bad if I say so myself. &amp;nbsp;Keep in mind, this isn't "based on" a timestamp or network card, it is a time stamp and specific network card ID. &amp;nbsp;You can permanently remove a whole block of GUIDs from existence by smashing network cards. &amp;nbsp;No risk of duplicates, period.&lt;/P&gt;
&lt;DIV class=post&gt;[&lt;I&gt;Actually, it's 16 guaranteed unique GUIDs per 100-nanosecond interval, or 160 million unique GUIDs per second. -Raymond&lt;/I&gt;]&lt;/DIV&gt;</description></item><item><title>re: GUIDs are globally unique, but substrings of GUIDs aren't</title><link>http://blogs.msdn.com/oldnewthing/archive/2008/06/27/8659071.aspx#8662134</link><pubDate>Fri, 27 Jun 2008 19:39:23 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8662134</guid><dc:creator>Josh</dc:creator><description>&lt;P&gt;Even better. &amp;nbsp;Sorry, didn't know the time interval off the top of my head. :-)&lt;/P&gt;
&lt;DIV class=post&gt;[&lt;I&gt;I didn't either, but I bothered to follow the link to the GUID spec. -Raymond&lt;/I&gt;]&lt;/DIV&gt;</description></item><item><title>re: GUIDs are globally unique, but substrings of GUIDs aren't</title><link>http://blogs.msdn.com/oldnewthing/archive/2008/06/27/8659071.aspx#8662160</link><pubDate>Fri, 27 Jun 2008 19:49:52 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8662160</guid><dc:creator>Nathan_works</dc:creator><description>&lt;p&gt;Looks like they are up to algorithm 5, according to a newer spec than the one Raymond linked to: &lt;a rel="nofollow" target="_new" href="http://www.faqs.org/rfcs/rfc4122.html"&gt;http://www.faqs.org/rfcs/rfc4122.html&lt;/a&gt;&lt;/p&gt;
</description></item><item><title>re: GUIDs are globally unique, but substrings of GUIDs aren't</title><link>http://blogs.msdn.com/oldnewthing/archive/2008/06/27/8659071.aspx#8662203</link><pubDate>Fri, 27 Jun 2008 20:03:43 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8662203</guid><dc:creator>Brian</dc:creator><description>&lt;p&gt;It's all fine and dandy until someone builds the 140,737,488,355,328th network card.&lt;/p&gt;
</description></item><item><title>re: GUIDs are globally unique, but substrings of GUIDs aren't</title><link>http://blogs.msdn.com/oldnewthing/archive/2008/06/27/8659071.aspx#8662224</link><pubDate>Fri, 27 Jun 2008 20:16:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8662224</guid><dc:creator>mikeb</dc:creator><description>&lt;p&gt;@josh:&lt;/p&gt;
&lt;p&gt;&amp;quot;Not bad if I say so myself.&amp;quot;&lt;/p&gt;
&lt;p&gt;So, you're the creator of the GUID generation algorithm? :-)&lt;/p&gt;
</description></item><item><title>re: GUIDs are globally unique, but substrings of GUIDs aren't</title><link>http://blogs.msdn.com/oldnewthing/archive/2008/06/27/8659071.aspx#8662384</link><pubDate>Fri, 27 Jun 2008 20:55:07 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8662384</guid><dc:creator>Ron Parker</dc:creator><description>&lt;p&gt;@Josh:&lt;/p&gt;
&lt;p&gt;Where do you get the number 16 from? &amp;nbsp;That seems to come from the 4-bit clock sequence number Raymond suggested for the 64-bit cluster-unique ID. &amp;nbsp;GUID algorithm 1 uses 14 bits for the clock sequence number, for 16,384 unique GUIDs per MAC address per 100ns interval, no?&lt;/p&gt;
&lt;p&gt;(Provided, of course, that your clock never goes backward. &amp;nbsp;If it does, and you're generating GUIDs at a rate of 16,384 every 100ns, your risk of collision rises to near 100%.)&lt;/p&gt;
</description></item><item><title>re: GUIDs are globally unique, but substrings of GUIDs aren't</title><link>http://blogs.msdn.com/oldnewthing/archive/2008/06/27/8659071.aspx#8662396</link><pubDate>Fri, 27 Jun 2008 20:58:43 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8662396</guid><dc:creator>njkayaker</dc:creator><description>&lt;p&gt;[I didn't either, but I bothered to follow the link to the GUID spec. -Raymond]&lt;/p&gt;
&lt;p&gt;Great! A well that will never run dry!&lt;/p&gt;
</description></item><item><title>re: GUIDs are globally unique, but substrings of GUIDs aren't</title><link>http://blogs.msdn.com/oldnewthing/archive/2008/06/27/8659071.aspx#8662468</link><pubDate>Fri, 27 Jun 2008 21:19:30 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8662468</guid><dc:creator>Alexandre Grigoriev</dc:creator><description>&lt;p&gt;&amp;gt;Provided, of course, that your clock never goes backward&lt;/p&gt;
&lt;p&gt;Stupid clock correction in Windows makes it possible, unfortunately.&lt;/p&gt;
</description></item><item><title>re: GUIDs are globally unique, but substrings of GUIDs aren't</title><link>http://blogs.msdn.com/oldnewthing/archive/2008/06/27/8659071.aspx#8662474</link><pubDate>Fri, 27 Jun 2008 21:21:54 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8662474</guid><dc:creator>Alexandre Grigoriev</dc:creator><description>&lt;P&gt;&amp;gt;[Actually, it's 16 guaranteed unique GUIDs per 100-nanosecond interval, or 160 million unique GUIDs per second. -Raymond]&lt;/P&gt;
&lt;P&gt;You mean your tick rate is 10 MHz? 100 ns is just kernel time unit, not actual resolution, or rate at which it changes. It only changes about 15 times per second, depending on HAL.&lt;/P&gt;
&lt;DIV class=post&gt;[&lt;I&gt;If you read the GUID spec (which I linked to) you can see how you can generate timestamps with greater precision than the clock tick. -Raymond&lt;/I&gt;]&lt;/DIV&gt;</description></item><item><title>re: GUIDs are globally unique, but substrings of GUIDs aren't</title><link>http://blogs.msdn.com/oldnewthing/archive/2008/06/27/8659071.aspx#8662519</link><pubDate>Fri, 27 Jun 2008 21:33:22 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8662519</guid><dc:creator>mikeb</dc:creator><description>&lt;p&gt;@Ron Parker:&lt;/p&gt;
&lt;p&gt;The clock sequence field is not intended to be used to allow more than one GUID to be generated within a 100ns interval. &amp;nbsp;The clock sequence field is specifically intended to handle the situation where the clock 'goes back in time' (due to a resetting the clock, restarting the machine or whatever).&lt;/p&gt;
&lt;p&gt;What Raymond calls 56 bits of time stamp with 4 bits of 'uniquifier' is really a 60 bit time stamp field with 100ns resolution. What's being described as 56 bit of timestamp with 4 bits uniquifier is probably that the clock being used to get the timestamp does not have a 100ns resolution, and the implementation is using a technique like the one described in RFC 4122 section 4.2.1.2 to get up to 16 UUID's per native clock tick.&lt;/p&gt;
&lt;p&gt;Basically with algorithm 1 (according to RFC4122) for a single generator instance, you get at most one UUID per 100ns interval. If you need more, the RFC suggests adding more MAC addresses so you can have several instances of the UUID gen going concurrently. &amp;nbsp;If you can't do something like that you have to stall or return an error.&lt;/p&gt;
&lt;p&gt;See RFC 4122 4.2.1.2.&lt;/p&gt;
</description></item><item><title>re: GUIDs are globally unique, but substrings of GUIDs aren't</title><link>http://blogs.msdn.com/oldnewthing/archive/2008/06/27/8659071.aspx#8662551</link><pubDate>Fri, 27 Jun 2008 21:42:45 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8662551</guid><dc:creator>Ron Parker</dc:creator><description>&lt;p&gt;@Alexandre:&lt;/p&gt;
&lt;p&gt;If you can get anything that runs Windows to generate 16,384 GUIDs every 100ns, tell me what the stock market looks like there in the 160+ GHz future. &amp;nbsp;And where do you store them all? &amp;nbsp;If you're not generating them at a sustained rate that's a significant fraction of that, the risk of collision goes way down, even if the clock goes backwards.&lt;/p&gt;
&lt;p&gt;RFC 4122 actually has a provision for clocks that don't tick every 100ns, allowing you to use the lower bits of the timestamp as a serial number. &amp;nbsp;It's not clear to me on first reading how that serial number interacts with the time sequence number, so the number of GUIDs you can generate on such a system without causing collisions might not be quite as high.&lt;/p&gt;
</description></item><item><title>re: GUIDs are globally unique, but substrings of GUIDs aren't</title><link>http://blogs.msdn.com/oldnewthing/archive/2008/06/27/8659071.aspx#8662567</link><pubDate>Fri, 27 Jun 2008 21:50:54 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8662567</guid><dc:creator>Ron Parker</dc:creator><description>&lt;p&gt;@mikeb:&lt;/p&gt;
&lt;p&gt;I see. &amp;nbsp;The RFC says &amp;quot;If the state was available, but the saved timestamp is later than the current timestamp, increment the clock sequence value&amp;quot; but Raymond said &amp;quot;When time appears to have stood still ... or gone backward ... the uniquifier is incremented.&amp;quot; &amp;nbsp;When I read the RFC, I missed the subtle difference. &amp;nbsp;So at most one GUID every 100ns it is.&lt;/p&gt;
</description></item><item><title>re: GUIDs are globally unique, but substrings of GUIDs aren't</title><link>http://blogs.msdn.com/oldnewthing/archive/2008/06/27/8659071.aspx#8662596</link><pubDate>Fri, 27 Jun 2008 22:02:38 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8662596</guid><dc:creator>mikeb</dc:creator><description>&lt;p&gt;[If you read the GUID spec (which I linked to) you can see how you can generate timestamps with greater precision than the clock tick. -Raymond]&lt;/p&gt;
&lt;p&gt;But you can't generate timestamps with a higher resolution than 100ns - that's what the timestamp field is defined to be. &amp;nbsp;So the spec discusses, for example, how to deal with the fact that your clock can only generate ticks with 10 microsecond resolution and you want your generator to be able to generate more than one UUID within the span of 10 microseconds.&lt;/p&gt;
&lt;p&gt;If you need to generate more than one UUID within a 100ns span (on average), you either need to have addition MAC addresses to 'uniquify' the node ID field or you need to have your generator stall or return an error.&lt;/p&gt;
&lt;p&gt;On the whole though, I don't think there are too many people having problems with generating too many GUIDs in too short a time period. &amp;nbsp;My machine has less than a 4GHz clock - so that's fewer than 400 clock cycles per 100ns interval here (if my cipherin' is correct).&lt;/p&gt;
</description></item><item><title>re: GUIDs are globally unique, but substrings of GUIDs aren't</title><link>http://blogs.msdn.com/oldnewthing/archive/2008/06/27/8659071.aspx#8662666</link><pubDate>Fri, 27 Jun 2008 22:30:12 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8662666</guid><dc:creator>Dave</dc:creator><description>&lt;p&gt;some other interesting notes about GUIDs that try to use MAC addresses as unique values:&lt;/p&gt;
&lt;p&gt;1) many network cards and devices now allow you to set the MAC address to whatever you want; some cable modems and that kind of thing rely on this functionality, apparently.&lt;/p&gt;
&lt;p&gt;2) for a while, at least, the dummy network adaptors created by Windows for dial-up connections and the like all had the same MAC address (i think it was &amp;quot;DEST\0\0&amp;quot; or something). &amp;nbsp;there were a lot of GUIDs floating around that had that decidedly non-unique value...&lt;/p&gt;
</description></item><item><title>re: GUIDs are globally unique, but substrings of GUIDs aren't</title><link>http://blogs.msdn.com/oldnewthing/archive/2008/06/27/8659071.aspx#8662681</link><pubDate>Fri, 27 Jun 2008 22:38:06 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8662681</guid><dc:creator>Anonymous</dc:creator><description>&lt;p&gt;A related post by Larry Osterman:&lt;/p&gt;
&lt;p&gt;UUIDs are only unique if you generate them...&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://blogs.msdn.com/larryosterman/archive/2005/07/21/441417.aspx"&gt;http://blogs.msdn.com/larryosterman/archive/2005/07/21/441417.aspx&lt;/a&gt;&lt;/p&gt;
</description></item><item><title>re: GUIDs are globally unique, but substrings of GUIDs aren't</title><link>http://blogs.msdn.com/oldnewthing/archive/2008/06/27/8659071.aspx#8662726</link><pubDate>Fri, 27 Jun 2008 23:01:05 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8662726</guid><dc:creator>Thor</dc:creator><description>&lt;p&gt;Beyond the specifics of the GUID generation, I love the initial problem statement. &amp;nbsp;(I am fairly new to the blog and haven't finished going back and reading them all but this must be a pattern.) &amp;nbsp;&lt;/p&gt;
&lt;p&gt;The customer's basic question is-- &amp;quot;for this problem, there is a solution, but I want it for less&amp;quot;. &lt;/p&gt;
&lt;p&gt;Without changing the a basic requirement (like local uniqueness versus global uniqueness in this example), it seems the only way this would be possibile is if the original solution was suboptimal. &amp;nbsp;While I frequently think that a given solution seems suboptimal, I almost always find that, no, whoever found it knew *tons* more about the problem than I had any idea existed.&lt;/p&gt;
&lt;p&gt;Granted questioning an optimal solution is how technology improves, but in a case like this, unless you are master of the intricacies of unique number generation, the chances seem quite slim that you will achieve the requirement (unique) with fewer resources (half the byters). &amp;nbsp;&lt;/p&gt;
&lt;p&gt;So, the root of the question pattern may be-- what are the requirements on which a solution is based and can any of them be relaxed?&lt;/p&gt;
</description></item><item><title>re: GUIDs are globally unique, but substrings of GUIDs aren't</title><link>http://blogs.msdn.com/oldnewthing/archive/2008/06/27/8659071.aspx#8662829</link><pubDate>Fri, 27 Jun 2008 23:53:13 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8662829</guid><dc:creator>eff  Five</dc:creator><description>&lt;p&gt;@Thor&lt;/p&gt;
&lt;p&gt;Very nicely put. I’m adding “what are the requirements on which a solution is based and can any of them be relaxed” to the “words to code by” list. I especially like it because its got understanding the requirements baked in&lt;/p&gt;
&lt;p&gt;Similar items on the list &lt;/p&gt;
&lt;p&gt;“never fix a bug you don’t understand” -&lt;a rel="nofollow" target="_new" href="http://www.links.org/?p=327"&gt;http://www.links.org/?p=327&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;And &lt;/p&gt;
&lt;p&gt; “A cache with a bad policy is another name for a memory leak” - &lt;a rel="nofollow" target="_new" href="http://blogs.msdn.com/oldnewthing/archive/2006/05/02/588350.aspx"&gt;http://blogs.msdn.com/oldnewthing/archive/2006/05/02/588350.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;“Random number generation is hard. [..] leave it to the experts. - &lt;a rel="nofollow" target="_new" href="http://blogs.msdn.com/oldnewthing/archive/2004/04/12/111596.aspx"&gt;http://blogs.msdn.com/oldnewthing/archive/2004/04/12/111596.aspx&lt;/a&gt;&lt;/p&gt;
</description></item><item><title>re: GUIDs are globally unique, but substrings of GUIDs aren't</title><link>http://blogs.msdn.com/oldnewthing/archive/2008/06/27/8659071.aspx#8662932</link><pubDate>Sat, 28 Jun 2008 01:00:17 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8662932</guid><dc:creator>Judge Dredd</dc:creator><description>&lt;p&gt;&amp;gt;&amp;gt; “never fix a bug you don’t understand” -&lt;a rel="nofollow" target="_new" href="http://www.links.org/?p=327"&gt;http://www.links.org/?p=327&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I disagree with the post..&lt;/p&gt;
&lt;p&gt;Better is &lt;/p&gt;
&lt;p&gt;Never leave ambiguous &amp;quot;bug-smelling&amp;quot; code around, at least not uncommented, and never rely on undetermined system behavior (OpenSSL relies on the memory being uninitialized.. which is a false assumption because it's not part of any contract and both OS, the loader, libc et al are free to zero-out - or something else - the uninit. memory).&lt;/p&gt;
&lt;p&gt;If it smells like a bug, it's a bug, at least in form. Correct code should never raise a suspect.&lt;/p&gt;
</description></item><item><title>re: GUIDs are globally unique, but substrings of GUIDs aren't</title><link>http://blogs.msdn.com/oldnewthing/archive/2008/06/27/8659071.aspx#8663116</link><pubDate>Sat, 28 Jun 2008 03:39:39 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8663116</guid><dc:creator>Miles Archer</dc:creator><description>&lt;p&gt;Judge Dred,&lt;/p&gt;
&lt;p&gt;I hope you don't work on any of my projects. There's a risk to fixing any code. If you don't weigh the risk vs reward you're asking for trouble. If you worked on my project and fixed code that &amp;quot;smells&amp;quot; without justification, their would be hell to pay.&lt;/p&gt;
</description></item><item><title>re: GUIDs are globally unique, but substrings of GUIDs aren't</title><link>http://blogs.msdn.com/oldnewthing/archive/2008/06/27/8659071.aspx#8663189</link><pubDate>Sat, 28 Jun 2008 06:21:05 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8663189</guid><dc:creator>Dean Harding</dc:creator><description>&lt;p&gt;&amp;quot;OpenSSL relies on the memory being uninitialized&amp;quot;&lt;/p&gt;
&lt;p&gt;If you're referring to the &amp;quot;Debian incident&amp;quot;, that is not true - OpenSSL does not rely on memory being uninitialized.&lt;/p&gt;
</description></item><item><title>re: GUIDs are globally unique, but substrings of GUIDs aren't</title><link>http://blogs.msdn.com/oldnewthing/archive/2008/06/27/8659071.aspx#8663195</link><pubDate>Sat, 28 Jun 2008 06:30:33 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8663195</guid><dc:creator>Jeff Tyrrill</dc:creator><description>&lt;p&gt;I really do wish hardware random number generators were standard order in modern processors, so we didn't have to rely on these elaborate algorithms simply to guarantee uniqueness, which are riddled with privacy implications. (I realize newer algorithms are much improved from the one in this post, but the point remains that not having access to guaranteed entropic data means a slew of pragmatic assumptions must be made and carefully weighted in the development of any unique number generation algorithm.)&lt;/p&gt;
&lt;p&gt;Using a cryptographic PRNG and guaranteed entropic source data, you don't need silly constructs like an &amp;quot;algorithm&amp;quot; counter to prevent collisions between &amp;quot;algorithms&amp;quot;. The size of the bitspace (128 bits) is guarantee enough, even with arbitrarily many algorithms, as long as they all have entropic source data and are reliable CSPRNGs.&lt;/p&gt;
&lt;p&gt;(Whatever the probability of number collision, it will be higher with a less entropic algorithm than a cryptographic PRNG anyway, so even if 128 bits isn't enough bitspace, you're still better off using a CSPRNG. A CSPRNG satisfies a greater requirement than uniqueness, but it _does_ satisfy uniqueness also.)&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://en.wikipedia.org/wiki/Cryptographically_secure_pseudorandom_number_generator"&gt;http://en.wikipedia.org/wiki/Cryptographically_secure_pseudorandom_number_generator&lt;/a&gt;&lt;/p&gt;
</description></item><item><title>re: GUIDs are globally unique, but substrings of GUIDs aren't</title><link>http://blogs.msdn.com/oldnewthing/archive/2008/06/27/8659071.aspx#8663293</link><pubDate>Sat, 28 Jun 2008 09:28:50 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8663293</guid><dc:creator>Yuhong Bao</dc:creator><description>&lt;p&gt;Similarly, hashing 2 7-byte values aren't as secure as hashing 1 14-byte value, as the LM hash showed.&lt;/p&gt;
</description></item><item><title>re: GUIDs are globally unique, but substrings of GUIDs aren't</title><link>http://blogs.msdn.com/oldnewthing/archive/2008/06/27/8659071.aspx#8663363</link><pubDate>Sat, 28 Jun 2008 11:24:56 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8663363</guid><dc:creator>Narr</dc:creator><description>&lt;p&gt;&amp;gt;Whatever the probability of number collision,&lt;/p&gt;
&lt;p&gt;&amp;gt;it will be higher with a less entropic&lt;/p&gt;
&lt;p&gt;&amp;gt;algorithm than a cryptographic PRNG anyway&lt;/p&gt;
&lt;p&gt;Global registry? _That_ would actually guarantee uniqueness. A 1:1, one-way hashed hardware ID + timestamp comes pretty close, too.&lt;/p&gt;
&lt;p&gt;&amp;gt;A CSPRNG satisfies a greater requirement than&lt;/p&gt;
&lt;p&gt;&amp;gt;uniqueness, but it _does_ satisfy uniqueness also.&lt;/p&gt;
&lt;p&gt;How? It's entirely possible for a collision to occur, so there's no guarantee, and it trivially does not satisfy. Also, what is your 'greater requirement'?&lt;/p&gt;
</description></item><item><title>re: GUIDs are globally unique, but substrings of GUIDs aren't</title><link>http://blogs.msdn.com/oldnewthing/archive/2008/06/27/8659071.aspx#8664960</link><pubDate>Sun, 29 Jun 2008 01:12:47 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8664960</guid><dc:creator>Xepol</dc:creator><description>&lt;p&gt;Or they could stop being data-cheap and just use a GUID....&lt;/p&gt;
</description></item><item><title>re: GUIDs are globally unique, but substrings of GUIDs aren't</title><link>http://blogs.msdn.com/oldnewthing/archive/2008/06/27/8659071.aspx#8666630</link><pubDate>Sun, 29 Jun 2008 10:28:49 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8666630</guid><dc:creator>SuperKoko</dc:creator><description>&lt;p&gt;From mikeb:&lt;/p&gt;
&lt;p&gt;&amp;quot;&lt;/p&gt;
&lt;p&gt;But you can't generate timestamps with a higher resolution than 100ns - that's what the timestamp field is defined to be.&lt;/p&gt;
&lt;p&gt;&amp;quot;&lt;/p&gt;
&lt;p&gt;On my computer, QueryPerformanceCounter has 10ns accuracy (the function call time itself is irrelevant). It uses the on-board clock which runs at approximatively 100Mhz.&lt;/p&gt;
&lt;p&gt;Why would you use GetTickCount?&lt;/p&gt;
&lt;p&gt;From Jeff Tyrrill:&lt;/p&gt;
&lt;p&gt;&amp;quot;&lt;/p&gt;
&lt;p&gt;I really do wish hardware random number generators were standard order in modern processors, so we didn't have to rely on these elaborate algorithms simply to guarantee uniqueness&lt;/p&gt;
&lt;p&gt;&amp;quot;&lt;/p&gt;
&lt;p&gt;On Linux, there's /dev/random, based on keystrokes entropy, and things like noise recorded from the sound card.&lt;/p&gt;
&lt;p&gt;Birthday's paradoxes remain.&lt;/p&gt;
</description></item><item><title>re: GUIDs are globally unique, but substrings of GUIDs aren't</title><link>http://blogs.msdn.com/oldnewthing/archive/2008/06/27/8659071.aspx#8668456</link><pubDate>Sun, 29 Jun 2008 23:46:22 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8668456</guid><dc:creator>AndyC</dc:creator><description>&lt;p&gt;@Jeff Tyrrill &lt;/p&gt;
&lt;p&gt;&amp;quot;I really do wish hardware random number generators were standard order in modern processors, so we didn't have to rely on these elaborate algorithms simply to guarantee uniqueness&amp;quot;&lt;/p&gt;
&lt;p&gt;If your random numbers are unique, your random number generator is broken.&lt;/p&gt;
</description></item><item><title>re: GUIDs are globally unique, but substrings of GUIDs aren't</title><link>http://blogs.msdn.com/oldnewthing/archive/2008/06/27/8659071.aspx#8669797</link><pubDate>Mon, 30 Jun 2008 05:58:49 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8669797</guid><dc:creator>mikeb</dc:creator><description>&lt;p&gt;@SuperKoko:&lt;/p&gt;
&lt;p&gt;&amp;gt;&amp;gt; On my computer, QueryPerformanceCounter has 10ns accuracy &amp;lt;&amp;lt;&lt;/p&gt;
&lt;p&gt;That's nice, but it doesn't solve the theoretical problem of generating more than one UUID every 100ns (on average) - the timestamp field in the UUID is in units of 100ns.&lt;/p&gt;
</description></item><item><title>re: GUIDs are globally unique, but substrings of GUIDs aren't</title><link>http://blogs.msdn.com/oldnewthing/archive/2008/06/27/8659071.aspx#8670449</link><pubDate>Mon, 30 Jun 2008 09:23:57 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8670449</guid><dc:creator>pZy</dc:creator><description>&lt;p&gt;German Wikipedia says for privacy reasons newer versions of Windows would not make use of the MAC address for creating GUIDs. &lt;/p&gt;
&lt;p&gt;Otherwise it would be possible to draw conclusions about the creator. &lt;/p&gt;
&lt;p&gt;Unfortunatley I didn't find that statement in the english wiki. &lt;/p&gt;
</description></item><item><title>re: GUIDs are globally unique, but substrings of GUIDs aren't</title><link>http://blogs.msdn.com/oldnewthing/archive/2008/06/27/8659071.aspx#8671582</link><pubDate>Mon, 30 Jun 2008 18:22:52 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8671582</guid><dc:creator>SuperKoko</dc:creator><description>&lt;p&gt;&amp;quot;&lt;/p&gt;
&lt;p&gt;That's nice, but it doesn't solve the theoretical problem of generating more than one UUID every 100ns (on average) - the timestamp field in the UUID is in units of 100ns.&lt;/p&gt;
&lt;p&gt;&amp;quot;&lt;/p&gt;
&lt;p&gt;That's still better than one GUID every 10 milliseconds with GetTickCount.&lt;/p&gt;
</description></item><item><title>re: GUIDs are globally unique, but substrings of GUIDs aren't</title><link>http://blogs.msdn.com/oldnewthing/archive/2008/06/27/8659071.aspx#8672006</link><pubDate>Mon, 30 Jun 2008 20:46:47 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8672006</guid><dc:creator>mikeb</dc:creator><description>&lt;p&gt;@SuperKoko:&lt;/p&gt;
&lt;p&gt;&amp;gt;&amp;gt; That's still better than one GUID every 10 milliseconds with GetTickCount. &amp;lt;&amp;lt;&lt;/p&gt;
&lt;p&gt;But you're not limited to a single UUID per 10ms tick, even if that's the hardware clock you might be stuck with. That's one of the things that section 4.2.1.2 of RFC 4122 discusses:&lt;/p&gt;
&lt;p&gt;--------------------------------&lt;/p&gt;
&lt;p&gt;A high resolution timestamp can be simulated by keeping a count of the number of UUIDs that have been generated with the same value of the system time, and using it to construct the low order bits of the timestamp. &amp;nbsp;The count will range between zero and the number of 100-nanosecond intervals per system time interval.&lt;/p&gt;
&lt;p&gt;--------------------------------&lt;/p&gt;
&lt;p&gt;So you can still get a 10000 unique UUIDs per 10ms tick. &amp;nbsp;But my point wasn't what timer resolution is best to use, but that by definition you can't get better resolution than 100ns resolution using Algorithm 1 to generate UUIDs. &amp;nbsp;Oh, and that the clock sequence field is not intended to be used to simulate a higher resolution - it's intended to deal with clocks getting out of 'sync' (or going back in time).&lt;/p&gt;
</description></item><item><title>Reflective Perspective - Chris Alcock  &amp;raquo; The Morning Brew #126</title><link>http://blogs.msdn.com/oldnewthing/archive/2008/06/27/8659071.aspx#8675673</link><pubDate>Tue, 01 Jul 2008 10:04:33 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8675673</guid><dc:creator>Reflective Perspective - Chris Alcock  &amp;raquo; The Morning Brew #126</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://blog.cwa.me.uk/2008/07/01/the-morning-brew-126/"&gt;http://blog.cwa.me.uk/2008/07/01/the-morning-brew-126/&lt;/a&gt;&lt;/p&gt;
</description></item><item><title>The GUID Guide &amp;laquo; SQL Dev&amp;#8217;s Playground</title><link>http://blogs.msdn.com/oldnewthing/archive/2008/06/27/8659071.aspx#8675799</link><pubDate>Tue, 01 Jul 2008 10:46:49 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8675799</guid><dc:creator>The GUID Guide &amp;laquo; SQL Dev&amp;#8217;s Playground</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://sqldev.wordpress.com/2008/07/01/the-guid-guide/"&gt;http://sqldev.wordpress.com/2008/07/01/the-guid-guide/&lt;/a&gt;&lt;/p&gt;
</description></item><item><title>re: GUIDs are globally unique, but substrings of GUIDs aren't</title><link>http://blogs.msdn.com/oldnewthing/archive/2008/06/27/8659071.aspx#8683326</link><pubDate>Thu, 03 Jul 2008 13:03:05 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8683326</guid><dc:creator>Andy R</dc:creator><description>&lt;p&gt;Your reduced GUID format is a good idea, not used often enough, but it makes one more assumption... that there is only one thread or process running on each computer.&lt;/p&gt;
</description></item><item><title>re: GUIDs are globally unique, but substrings of GUIDs aren't</title><link>http://blogs.msdn.com/oldnewthing/archive/2008/06/27/8659071.aspx#8685886</link><pubDate>Fri, 04 Jul 2008 01:29:23 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8685886</guid><dc:creator>SuperKoko</dc:creator><description>&lt;p&gt;&amp;quot;&lt;/p&gt;
&lt;p&gt;Your reduced GUID format is a good idea, not used often enough, but it makes one more assumption... that there is only one thread or process running on each computer.&lt;/p&gt;
&lt;p&gt;&amp;quot;&lt;/p&gt;
&lt;p&gt;No. It just assumes that you use only one generator function (e.g. in a dynamic or static library). In that case, it's free to use shared variables and mutexes to safely manager GUIDs generation.&lt;/p&gt;
</description></item><item><title>Interesting Links 7/09/2007</title><link>http://blogs.msdn.com/oldnewthing/archive/2008/06/27/8659071.aspx#8712437</link><pubDate>Wed, 09 Jul 2008 15:38:55 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8712437</guid><dc:creator>Matt Johnson's Technical Adventures</dc:creator><description>&lt;p&gt;The list is a little longer today because of not posting last week. Enjoy! Microsoft Advanced Windows&lt;/p&gt;
</description></item></channel></rss>