Generate an id that is unique among all YUI instances
@method guid
@param pre {string} optional guid prefix
@return {string} the guid
172460
function(pre) {
        var id =  this.Env._guidp + (++this.Env._uidx);
        return (pre) ? (pre + id) : id;
    }
1368872
function generateUniqueHubId() {
		//TODO ensure generated hub id is unique (not in db)
		// do {
		var length = 10;
		var letters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUV0123456789';
		var s = '';
		for (var i=0; i<length; i++) {
			s += letters.charAt(Math.floor(Math.random() * letters.length));
		}
		// } while (s == 0); //TODO actually check in db for value existence

		return s;
	}
841188
function gid(length) {
      if (isUdf(length)) length = 12;
      var charSet = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ', id = '', i = -1;
      while (++i< length) id += charSet[random(charSet.length)];
      return id;
    }
146660
function getId(record) {
    Validate.isObject(record);
    Validate.notNull(record);

    for (var property in record) {
        if (property.toLowerCase() === idPropertyName.toLowerCase()) {
            return record[property];
        }
    }
}
428379
def html_id(prefix, index)
      prefix = prefix || self.engine_id
      prefix, index = prefix.to_s, index.to_s

      return nil if index.empty?
      return nil if prefix.empty?

      return "#{prefix}_#{index}"
    end
1271944
function guid() {
    function _s4() {
        return Math.floor(
            (1 + Math.random()) * 0x10000
        ).toString(16).substring(1);
    }
    return _s4() + _s4() + '-' + _s4() + '-' + _s4() + '-' + _s4() + '-' + _s4() + _s4() + _s4();
}
1173452
function ensureID(options, prop, callback) {
  if(options[prop]) {
    return callback();
  }

  options.guid(function(err, id) {
    if(err) {
      return callback(err);
    }
    options[prop] = id;
    callback();
  });
}
1013582
def uniqueID(size=6, chars=string.ascii_uppercase + string.digits):
    """"""
    return ''.join(random.choice(chars) for x in xrange(size))
479704
function wrappedGuidFn(context) {
    return function (callback) {
      // Skip the duplicate ID check if asked to
      if (flags.includes(FS_NODUPEIDCHECK)) {
        callback(null, guid());
        return;
      }

      // Otherwise (default) make sure this id is unused first
      function guidWithCheck(callback) {
        const id = guid();
        context.getObject(id, function (err, value) {
          if (err) {
            callback(err);
            return;
          }

          // If this id is unused, use it, otherwise find another
          if (!value) {
            callback(null, id);
          } else {
            guidWithCheck(callback);
          }
        });
      }
      guidWithCheck(callback);
    };
  }
803831
function getUniqueItemId(selector) {

            var base_id = selectorToId(selector),
                id = base_id,
                numeric_suffix = 0;

            while (used_item_ids.indexOf(id) !== -1) {
                id = base_id + "_" + ++numeric_suffix;
            }

            used_item_ids.push(id);
            return id;
        }
1324462
@Nonnull
    public static String getIRIFromNodeID(String nodeID) {
        if (nodeID.startsWith(PREFIX_SHARED_NODE)) {
            return nodeID;
        }
        return PREFIX_SHARED_NODE + nodeID.replace(NODE_ID_PREFIX, "");
    }
731950
def _generate_id(self):
        
        name = self.name.replace(self.special_separator, "-").replace(".", "-")
        loc = "\/"
        if self.location:
            loc = self.location
        _id = "{PREFIX}{SEP}{NAME}{HASH}{SEP}".format(
            PREFIX=constants.CONU_ARTIFACT_TAG,
            NAME=name,
            HASH=hashlib.sha512(loc).hexdigest()[: 10],
            SEP=self.special_separator
        )
        return _id
896724
function(obj) {

            this.guid.id = this.guid.id || 1;
            obj.id = (obj.id === undefined ? 'j_' + this.guid.id++ : obj.id);
            return obj.id;
        }
1160872
def create_unique_id(prefix, existing_ids):
    
    if prefix in existing_ids:
        suffix = 1
        while True:
            new_id = '{}_{}'.format(prefix, suffix)
            if new_id not in existing_ids:
                return new_id
            suffix += 1

    return prefix
815709
function guid() {
    let curr = (new Date()).valueOf().toString();
    return [
        '4b534c46',  // Fixed first group. and a trick
        rand16Num(4),
        '4' + rand16Num(3),  // The first character of 3rd group is '4'.
        rand16Num(4),
        curr.substring(0, 12)
    ].join('-');
}
234703
function MultiId(node) {
  this.nodes = Object.create(null);
  this.nodes[node._nid] = node;
  this.length = 1;
  this.firstNode = undefined;
}
108820
@Override
  public Guid guid() throws IOException {
    StringBuilder uniqueString = new StringBuilder();
    uniqueString.append(getFileStatus().getModificationTime());
    uniqueString.append(getFileStatus().getLen());
    uniqueString.append(getFileStatus().getPath());
    return Guid.fromStrings(uniqueString.toString());
  }