title: Creating custom Object ID in MongoDB
body: <p>I am creating a service for which I will use MongoDB as a storage backend.
  The service will produce a hash of the user input and then see if that same hash (+ input) already exists in our dataset.</p>
  
  <p>The hash will be unique yet random ( = non-incremental/sequential), so my question is:</p>
  
  <ol>
  <li>Is it -legitimate- to use a random value for an Object ID? Example:</li>
  </ol>
  
  <p><code>$object_id = new MongoId(HEX-OF-96BIT-HASH);</code></p>
  
  <p>Or will MongoDB treat the ObjectID differently from other server-produced ones, since a "real" ObjectID also contains timestamps, machine_id, etc?</p>
  
  <p>What are the pros and cons of using a 'random' value? I guess it would be statistically slower for the engine to update the index on inserts when the new _id's are not in any way incremental - am I correct on that?</p>