code: function uuidRandom(arg1, arg2) {
  
      var options = arg1 || {};
      var callback = typeof arg1 === "function" ? arg1 : arg2;
  
      var buffer = crypto.randomBytes(16);
  
      buffer[6] = (buffer[6] & 0x0f) | 0x40;
      buffer[8] = (buffer[8] & 0x3f) | 0x80;
  
      var result;
      switch (options.encoding && options.encoding[0]) {
          case "b":
          case "B":
              result = buffer;
              break;
          case "o":
          case "U":
              result = new UUID(buffer);
              break;
          default:
              result = byte2hex[buffer[0]] + byte2hex[buffer[1]] +
                       byte2hex[buffer[2]] + byte2hex[buffer[3]] + "-" +
                       byte2hex[buffer[4]] + byte2hex[buffer[5]] + "-" +
                       byte2hex[(buffer[6] & 0x0f) | 0x40] +
                       byte2hex[buffer[7]] + "-" +
                       byte2hex[(buffer[8] & 0x3f) | 0x80] +
                       byte2hex[buffer[9]] + "-" +
                       byte2hex[buffer[10]] + byte2hex[buffer[11]] +
                       byte2hex[buffer[12]] + byte2hex[buffer[13]] +
                       byte2hex[buffer[14]] + byte2hex[buffer[15]];
              break;
      }
      if (callback) {
          setImmediate(function () {
              callback(null, result);
          });
      } else {
          return result;
      }
  }
docs: v4