title: what are the smallest and largest valid type-1 UUIDs?
body: <p>i have been reading the UUID RFC at <a href="http://www.ietf.org/rfc/rfc4122.txt" rel="nofollow">http://www.ietf.org/rfc/rfc4122.txt</a> and experimenting using the python <code>uuid</code> module.  for ease of explanation, here is the UUID diagram lifted from the spec.</p>
  
  <pre><code>    0                   1                   2                   3
      0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     |                          time_low                             |
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     |       time_mid                |         time_hi_and_version   |
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     |clk_seq_hi_res |  clk_seq_low  |         node (0-1)            |
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     |                         node (2-5)                            |
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  </code></pre>
  
  <p>according to my reading of the spec, the smallest type-1 UUID should have time_low, time_mid, clk_seq_hi_res, clk_seq_low, and node set to all 0s, and time_hi_and_version should have bit 15 set to 1.  the largest type-1 UUID should have time_low, time_mid, clk_seq_hi_res, clk_seq_low, and node set to all 1s, and time_hi_and_version set to all 1s except for bits 12, 13, and 14.</p>
  
  <p>however, attempting to generate these in python fails:</p>
  
  <pre><code>&gt;&gt;&gt; u = uuid.UUID("{00000000-0000-0000-0001-00000000}")
  Traceback (most recent call last):
    File "&lt;stdin&gt;", line 1, in &lt;module&gt;
    File "/usr/local/Cellar/python/2.7.4/Frameworks/Python.framework/Versions/2.7/lib/python2.7/uuid.py", line 134, in __init__
      raise ValueError('badly formed hexadecimal UUID string')
  ValueError: badly formed hexadecimal UUID string
  
  &gt;&gt;&gt; u = uuid.UUID("{ffffffff-ffff-ffff-fff1-ffffffff}")                                                                                                                                                          
  Traceback (most recent call last):
    File "&lt;stdin&gt;", line 1, in &lt;module&gt;
    File "/usr/local/Cellar/python/2.7.4/Frameworks/Python.framework/Versions/2.7/lib/python2.7/uuid.py", line 134, in __init__
      raise ValueError('badly formed hexadecimal UUID string')
  ValueError: badly formed hexadecimal UUID string
  </code></pre>
  
  <p>i assume i'm reading the spec incorrectly, but i'm at a loss.</p>