title: MongoDb: After inserting a UUID with ruby, c# can't convert it to GUID
body: <p>I am attempting to insert an object into mongoDB using ruby and retrieve it using c# and the NoRM driver.</p>
  
  <p>All seemed to be progressing well until I wanted to use a Guid within my c# object.</p>
  
  <p>I used the following code to set a UUID in ruby before inserting it into mongo (as suggested by this blog post <a href="http://blog.mikeobrien.net/2010/08/working-with-guids-in-mongodb-with-ruby.html" rel="nofollow">http://blog.mikeobrien.net/2010/08/working-with-guids-in-mongodb-with-ruby.html</a>):</p>
  
  <pre><code>BSON::Binary.new("d7b73eed91c549bfaa9ea3973aa97c7b", BSON::Binary::SUBTYPE_UUID)
  </code></pre>
  
  <p>When retrieving this object in c# the exception "Byte array for GUID must be exactly 16 bytes long." was thrown.</p>
  
  <p>Using the administrative shell I inspected the contents of the object. The guid property had been set to </p>
  
  <pre><code>BinData(3,"ZDdiNzNlZWQ5MWM1NDliZmFhOWVhMzk3M2FhOTdjN2I=")
  </code></pre>
  
  <p>However if I inserted the same Guid using c# the guid property was set to</p>
  
  <pre><code>BinData(3,"7T6318WRv0mqnqOXOql8ew==")
  </code></pre>
  
  <p>Any ideas what I'm doing wrong?</p>