Creates a unique string usable as a schema name. Constructed with the
character 'u' plus a UUID (stripped of non-alphanumeric characters).
@return the unique string
18889
protected static String createUniqueSchema() {
        String uuid = UUID.randomUUID().toString();
        uuid = allowedSchemaChars.retainFrom(uuid);
        String schema = 'u' + uuid;
        return schema;
    }
496182
final public static function generateUidie():string
    {
        // i for iumio
        $str = "i";
        // Create a string with Alphabetic letter
        $str .= chr(rand(65, 90));
        // Insert the timestamp
        $str .= time();
        // Create an other unique identifier with lenght 5
        $uniqid = substr(uniqid("X"), 5);
        // concat all
        $str .= substr($uniqid, 5);

        return ($str);
    }
812944
public String fullyQualifiedSymbolName(String name) {
        if (name.equals(SymbolsTable.ME)) {
            return "$".concat(id());
        } else if (name.startsWith("$")) {
            return "$" + id() + '.' + name.substring(1);
        }
        return id() + '.' + name;
    }
759839
public static UUID randomUUID(boolean isSecure) {
		final Random ng = isSecure ? Holder.numberGenerator : RandomUtil.getRandom();

		byte[] randomBytes = new byte[16];
		ng.nextBytes(randomBytes);
		randomBytes[6] &= 0x0f; /* clear version */
		randomBytes[6] |= 0x40; /* set to version 4 */
		randomBytes[8] &= 0x3f; /* clear variant */
		randomBytes[8] |= 0x80; /* set to IETF variant */
		return new UUID(randomBytes);
	}
534529
public String getUuid() {
    if (StringUtil.isEmpty(this.uuid)) {
      this.uuid = UUID.randomUUID().toString().toLowerCase();
    }
    return this.uuid;
  }
948924
@Override
  public String generateNextName() {
    String name;
    do {
      name = prefix;
      int i = nameCount;

      if (name.isEmpty()) {
        int pos = i % firstChars.length;
        name = String.valueOf(firstChars[pos].name);
        i /= firstChars.length;
      }

      while (i > 0) {
        i--;
        int pos = i % nonFirstChars.length;
        name += nonFirstChars[pos].name;
        i /= nonFirstChars.length;
      }

      nameCount++;

      // Make sure it's not a JS keyword or reserved name.
    } while (TokenStream.isKeyword(name) || reservedNames.contains(name));

    return name;
  }
854818
private function generateUniqueToken() {
		$s = strtoupper(md5(uniqid(rand(),true))); 
    	return substr($s,0,8) . '-' . 
	        substr($s,8,4) . '-' . 
	        substr($s,12,4). '-' . 
	        substr($s,16,4). '-' . 
	        substr($s,20); 
	}
972746
public final String key() {
    key = (key == null) ? UUID.randomUUID().toString() : key;
    return key;
  }
392564
static String serialize(UUID uuid) {

        StringBuilder sb = new StringBuilder();

        // Get UUID type version
        ByteBuffer bb = UUIDType.instance.decompose(uuid);
        int version = (bb.get(bb.position() + 6) >> 4) & 0x0f;

        // Add version at the beginning
        sb.append(ByteBufferUtils.toHex((byte) version));

        // If it's a time based UUID, add the UNIX timestamp
        if (version == 1) {
            long timestamp = uuid.timestamp();
            String timestampHex = ByteBufferUtils.toHex(Longs.toByteArray(timestamp));
            sb.append(timestampHex);
        }

        // Add the UUID itself
        sb.append(ByteBufferUtils.toHex(bb));
        return sb.toString();
    }
959819
def uuid(self):
        '''
        '''
        pk = self.pkvalue()
        if not pk:
            raise self.DoesNotExist(
                'Object not saved. Cannot obtain universally unique id')
        return self.get_uuid(pk)
1356797
public static function UUID(): string
    {
//        $data = Yii::$app->security->generateRandomKey(16);
//        assert(strlen($data) == 16);
//        $data[6] = chr(ord($data[6]) & 0x0f | 0x40); // set version to 0100
//        $data[8] = chr(ord($data[8]) & 0x3f | 0x80); // set bits 6-7 to 10
//        return vsprintf('%s%s-%s-%s-%s-%s%s%s', str_split(bin2hex($data), 4));

        return sprintf('%04x%04x-%04x-%04x-%04x-%04x%04x%04x',

            // 32 bits for "time_low"
            random_int(0, 0xffff), random_int(0, 0xffff),

            // 16 bits for "time_mid"
            random_int(0, 0xffff),

            // 16 bits for "time_hi_and_version", four most significant bits holds version number 4
            random_int(0, 0x0fff) | 0x4000,

            // 16 bits, 8 bits for "clk_seq_hi_res", 8 bits for "clk_seq_low", two most significant bits holds zero and
            // one for variant DCE1.1
            random_int(0, 0x3fff) | 0x8000,

            // 48 bits for "node"
            random_int(0, 0xffff), random_int(0, 0xffff), random_int(0, 0xffff)
        );
    }
177741
def unique(self, name):
    """"""
    # Make sure the name is valid
    name = self.valid(name)
    # Make sure it's not too long
    name = self.trim(name)
    # Now make sure it's unique
    unique_name = name
    i = 2
    while unique_name in self.names:
      unique_name = name + str(i)
      i += 1
    self.names.add(unique_name)
    return unique_name
1363818
public String createUniqueName(String name) {
		if (!isDuplicateName(name)) {
			return name;
		}
		if (name.matches(".*\\(\\d*\\)")) { //$NON-NLS-1$
			final int start = name.lastIndexOf('(');
			final int end = name.lastIndexOf(')');
			final String stringInt = name.substring(start + 1, end);
			final int numericValue = Integer.parseInt(stringInt);
			final String newName = name.substring(0, start + 1) + (numericValue + 1) + ")"; //$NON-NLS-1$
			return createUniqueName(newName);
		}
		return createUniqueName(name + " (1)"); //$NON-NLS-1$
	}
434427
public static PactDslRootValue uuid() {
    PactDslRootValue value = new PactDslRootValue();
    value.generators.addGenerator(Category.BODY, "", UuidGenerator.INSTANCE);
    value.setValue("e2490de5-5bd3-43d5-b7c4-526e33f71304");
    value.setMatcher(value.regexp(UUID_REGEX));
    return value;
  }
1106224
def generate_unique_name(name_prefix, reservation_id=None):
    
    if reservation_id and isinstance(reservation_id, str) and len(reservation_id) >= 4:
        unique_id = str(uuid.uuid4())[:4] + "-" + reservation_id[-4:]
    else:
        unique_id = str(uuid.uuid4())[:8]
    return name_prefix + "_" + unique_id
851311
public String toUnicodeString() {
        if (encoding != null && encoding.length() != 0)
            return value;
        getBytes();
        if (bytes.length >= 2 && bytes[0] == (byte)254 && bytes[1] == (byte)255)
            return PdfEncodings.convertToString(bytes, PdfObject.TEXT_UNICODE);
        else
            return PdfEncodings.convertToString(bytes, PdfObject.TEXT_PDFDOCENCODING);
    }
921633
public static function uuid()
    {
        mt_srand((double)microtime() * 10000);
        $charId = md5(uniqid(rand(), true));
        $uuid = [
            substr($charId, 0, 8),
            substr($charId, 8, 4),
            substr($charId, 12, 4),
            substr($charId, 16, 4),
            substr($charId, 20, 12)
        ];

        return join('-', $uuid);
    }