<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: UUID generator for PHP</title>
	<atom:link href="http://www.shapeshifter.se/2008/09/29/uuid-generator-for-php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.shapeshifter.se/2008/09/29/uuid-generator-for-php/</link>
	<description>Mostly miscellaneous technical mumbo-jumbo.</description>
	<lastBuildDate>Sun, 05 Sep 2010 01:48:46 +0200</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Lysender</title>
		<link>http://www.shapeshifter.se/2008/09/29/uuid-generator-for-php/comment-page-1/#comment-2763</link>
		<dc:creator>Lysender</dc:creator>
		<pubDate>Wed, 10 Mar 2010 05:16:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.shapeshifter.se/?p=352#comment-2763</guid>
		<description>I have modified them so that it will convert binary back to string or byte etc

    static private function conv_bin2byte($src) {
        // array_merge - reindex since unpack starts at index 1
        return array_merge(unpack(&#039;C16&#039;, $src));
    }
    
    static private function conv_bin2field($src) {
        $byte = self::conv_bin2byte($src);
        return self::conv_byte2field($byte);
    }
    
    static private function conv_bin2string($src) {
        $byte = self::conv_bin2byte($src);
        return self::conv_byte2string($byte);
    }</description>
		<content:encoded><![CDATA[<p>I have modified them so that it will convert binary back to string or byte etc</p>
<p>    static private function conv_bin2byte($src) {<br />
        // array_merge &#8211; reindex since unpack starts at index 1<br />
        return array_merge(unpack(&#8217;C16&#8242;, $src));<br />
    }</p>
<p>    static private function conv_bin2field($src) {<br />
        $byte = self::conv_bin2byte($src);<br />
        return self::conv_byte2field($byte);<br />
    }</p>
<p>    static private function conv_bin2string($src) {<br />
        $byte = self::conv_bin2byte($src);<br />
        return self::conv_byte2string($byte);<br />
    }</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lysender</title>
		<link>http://www.shapeshifter.se/2008/09/29/uuid-generator-for-php/comment-page-1/#comment-2762</link>
		<dc:creator>Lysender</dc:creator>
		<pubDate>Wed, 10 Mar 2010 04:44:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.shapeshifter.se/?p=352#comment-2762</guid>
		<description>How do I convert a binary back to string or byte or field? 

Uuid::convert($id, Uuid::FMT_BINARY, Uuid::FMT_STRING) 

is not yet supported. It is just now that I notice the problem.</description>
		<content:encoded><![CDATA[<p>How do I convert a binary back to string or byte or field? </p>
<p>Uuid::convert($id, Uuid::FMT_BINARY, Uuid::FMT_STRING) </p>
<p>is not yet supported. It is just now that I notice the problem.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Universally Unique Identifier (UUID) in PHP und MySQL &#187; Webmaid.de</title>
		<link>http://www.shapeshifter.se/2008/09/29/uuid-generator-for-php/comment-page-1/#comment-2756</link>
		<dc:creator>Universally Unique Identifier (UUID) in PHP und MySQL &#187; Webmaid.de</dc:creator>
		<pubDate>Thu, 25 Feb 2010 08:45:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.shapeshifter.se/?p=352#comment-2756</guid>
		<description>[...] und als Klasse bereit gestellt. Bei der Suche im Netz habe ich zwei Varianten entdeckt: DrUUID und UUID Generator. Außerdem kann man auch das PECL Package uuid nutzen, welches jedoch die libuuid (des Projekts [...]</description>
		<content:encoded><![CDATA[<p>[...] und als Klasse bereit gestellt. Bei der Suche im Netz habe ich zwei Varianten entdeckt: DrUUID und UUID Generator. Außerdem kann man auch das PECL Package uuid nutzen, welches jedoch die libuuid (des Projekts [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gavitron</title>
		<link>http://www.shapeshifter.se/2008/09/29/uuid-generator-for-php/comment-page-1/#comment-2633</link>
		<dc:creator>Gavitron</dc:creator>
		<pubDate>Thu, 17 Dec 2009 20:58:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.shapeshifter.se/?p=352#comment-2633</guid>
		<description>Actually, after several hours of testing, I have identified a significant bug in this implementation.  If you generate a version 3 or 5 UUID, using a namespace UUID with the first byte &gt; 8, your code overflows, and generates invalid UUIDs.  further, this invalid UUID is the same for all namespace UUIDs &gt;80000000-0000-0000-0000-00000000000</description>
		<content:encoded><![CDATA[<p>Actually, after several hours of testing, I have identified a significant bug in this implementation.  If you generate a version 3 or 5 UUID, using a namespace UUID with the first byte &gt; 8, your code overflows, and generates invalid UUIDs.  further, this invalid UUID is the same for all namespace UUIDs &gt;80000000-0000-0000-0000-00000000000</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David</title>
		<link>http://www.shapeshifter.se/2008/09/29/uuid-generator-for-php/comment-page-1/#comment-2102</link>
		<dc:creator>David</dc:creator>
		<pubDate>Tue, 25 Aug 2009 20:33:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.shapeshifter.se/?p=352#comment-2102</guid>
		<description>Thanks for the great class!

One note is that many implementations claim that the example for version 3 as shown in RFC4122 is incorrect (OSSP uuid, python) where the value generated should actually be 3d813cbb-47fb-32ba-91df-831e1593ac29.  If one needs compatibility with these (and other) libraries for version 3/5 one can remove lines 163-165 and 180-182 (byte swapping lines) and get matching results.</description>
		<content:encoded><![CDATA[<p>Thanks for the great class!</p>
<p>One note is that many implementations claim that the example for version 3 as shown in RFC4122 is incorrect (OSSP uuid, python) where the value generated should actually be 3d813cbb-47fb-32ba-91df-831e1593ac29.  If one needs compatibility with these (and other) libraries for version 3/5 one can remove lines 163-165 and 180-182 (byte swapping lines) and get matching results.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: fli</title>
		<link>http://www.shapeshifter.se/2008/09/29/uuid-generator-for-php/comment-page-1/#comment-1879</link>
		<dc:creator>fli</dc:creator>
		<pubDate>Tue, 07 Jul 2009 14:01:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.shapeshifter.se/?p=352#comment-1879</guid>
		<description>The bugs mentioned in the posts above should have been fixed now.</description>
		<content:encoded><![CDATA[<p>The bugs mentioned in the posts above should have been fixed now.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jonovic</title>
		<link>http://www.shapeshifter.se/2008/09/29/uuid-generator-for-php/comment-page-1/#comment-1615</link>
		<dc:creator>jonovic</dc:creator>
		<pubDate>Wed, 27 May 2009 13:26:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.shapeshifter.se/?p=352#comment-1615</guid>
		<description>I&#039;ve tried on Php 5.2.6 on Windows and fall into trouble with random generation. Time_low part is generated using mt_rand with interval set to 0,0xffffffff. The mt_rand function however uses signed integer for parameter and that&#039;s why the resulting value is always negative. When passing to sprintf the result of time_low part is always 0.</description>
		<content:encoded><![CDATA[<p>I&#8217;ve tried on Php 5.2.6 on Windows and fall into trouble with random generation. Time_low part is generated using mt_rand with interval set to 0,0xffffffff. The mt_rand function however uses signed integer for parameter and that&#8217;s why the resulting value is always negative. When passing to sprintf the result of time_low part is always 0.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: conzio &#187; Die UUID&#160;&#171;</title>
		<link>http://www.shapeshifter.se/2008/09/29/uuid-generator-for-php/comment-page-1/#comment-1593</link>
		<dc:creator>conzio &#187; Die UUID&#160;&#171;</dc:creator>
		<pubDate>Sun, 03 May 2009 07:32:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.shapeshifter.se/?p=352#comment-1593</guid>
		<description>[...] besonders anspruchsvolle Situationen und Sicherheitsfanatiker hat &#8216;fli&#8217; einen UUID-Generator geschrieben, der keine Wünsche offen [...]</description>
		<content:encoded><![CDATA[<p>[...] besonders anspruchsvolle Situationen und Sicherheitsfanatiker hat &#8216;fli&#8217; einen UUID-Generator geschrieben, der keine Wünsche offen [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: J. King</title>
		<link>http://www.shapeshifter.se/2008/09/29/uuid-generator-for-php/comment-page-1/#comment-1526</link>
		<dc:creator>J. King</dc:creator>
		<pubDate>Sat, 11 Apr 2009 19:23:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.shapeshifter.se/?p=352#comment-1526</guid>
		<description>I was very excited to see your implementation of RFC4122, because I was looking to use UUIDs for Atom and didn&#039;t want something merely &quot;UUID-like&quot; as all these other PHP implementations are.  However, I hate to break it to you, but your implementation of Version 1 UUIDs seems to be broken in a number of ways.  Besides the clock sequence (which is understandable) your implementation seems to use a null MAC node (whereas it should generate a random one), but worst of all the encoding of the time is completely wrong! :(  If you plug the output of your generator into the time extractor at http://www.famkruithof.net/uuid/uuidgen?typeReq=-1 (which I know to be correct: I checked with known timestamp values) you&#039;re left with a time several centuries from now.  If you use a date in the past the disparity is even greater (several -millennia- from now...).  I just thought you should know.

If you&#039;re curious I also wrote my own implementation from scratch yesterday since I had no one to depend on but myself (and I didn&#039;t like your API anyway---sorry).  I&#039;d very much like to know what you think of it. :)

http://jkingweb.ca/code/php/lib.uuid/</description>
		<content:encoded><![CDATA[<p>I was very excited to see your implementation of RFC4122, because I was looking to use UUIDs for Atom and didn&#8217;t want something merely &#8220;UUID-like&#8221; as all these other PHP implementations are.  However, I hate to break it to you, but your implementation of Version 1 UUIDs seems to be broken in a number of ways.  Besides the clock sequence (which is understandable) your implementation seems to use a null MAC node (whereas it should generate a random one), but worst of all the encoding of the time is completely wrong! <img src='http://www.shapeshifter.se/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' />   If you plug the output of your generator into the time extractor at <a href="http://www.famkruithof.net/uuid/uuidgen?typeReq=-1" rel="nofollow">http://www.famkruithof.net/uuid/uuidgen?typeReq=-1</a> (which I know to be correct: I checked with known timestamp values) you&#8217;re left with a time several centuries from now.  If you use a date in the past the disparity is even greater (several -millennia- from now&#8230;).  I just thought you should know.</p>
<p>If you&#8217;re curious I also wrote my own implementation from scratch yesterday since I had no one to depend on but myself (and I didn&#8217;t like your API anyway&#8212;sorry).  I&#8217;d very much like to know what you think of it. <img src='http://www.shapeshifter.se/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><a href="http://jkingweb.ca/code/php/lib.uuid/" rel="nofollow">http://jkingweb.ca/code/php/lib.uuid/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Konrad</title>
		<link>http://www.shapeshifter.se/2008/09/29/uuid-generator-for-php/comment-page-1/#comment-598</link>
		<dc:creator>Konrad</dc:creator>
		<pubDate>Sun, 22 Feb 2009 20:38:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.shapeshifter.se/?p=352#comment-598</guid>
		<description>Thank you.</description>
		<content:encoded><![CDATA[<p>Thank you.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
