So, every document has a document or node ID (nid), a collection ID (cid), and a unique object ID (oid). The latter never changes, even if the document is moved from collection to collection. The oid is generated from a base 64 ([A-Za-z0-9_-]) hash of a singleton class that grabs 10ms-delayed snaps of System.currentTimeMillis(), so no two oids are ever the same. The class generates only proper XML Names.
Check out the mix:referenceable type in JCR; it does pretty much the same thing as your oid.
/Janne
