SecureRandom.uuid not good enough? What do you mean by "guaranteed UUID"? 

The check around it is being extra paranoid, but mostly exists to check for having made a coding error around it (which turned up an issue when i changed things around recently.)