根据指定的字节数组获取类型 3（基于名称的）UUID 的静态工厂。

@param name 用于构造 UUID 的字节数组。

@return 根据指定数组生成的 {@code UUID}
177814
public static UUID nameUUIDFromBytes(byte[] name) {
		MessageDigest md;
		try {
			md = MessageDigest.getInstance("MD5");
		} catch (NoSuchAlgorithmException nsae) {
			throw new InternalError("MD5 not supported");
		}
		byte[] md5Bytes = md.digest(name);
		md5Bytes[6] &= 0x0f; /* clear version */
		md5Bytes[6] |= 0x30; /* set to version 3 */
		md5Bytes[8] &= 0x3f; /* clear variant */
		md5Bytes[8] |= 0x80; /* set to IETF variant */
		return new UUID(md5Bytes);
	}
198576
public static String getFieldNameWithJavaCase(final String name)
    {
       return name==null?null:Character.toLowerCase(name.charAt(0))+name.substring(1);
    }
1216023
protected static String nameToId(String name) {
        try {
            return URLEncoder.encode(name, "UTF-8");
        } catch (UnsupportedEncodingException e) {
            // should not happen
            throw new RuntimeException("Unsupported encoding", e);
        }
    }
1182842
String nameTokenFor(String name) {
        Integer token = nameToToken.get(name);
        if (token == null) {
            token = nameToToken.size();
            nameToToken.put(name, token);
        }
        return "#" + token;
    }
924608
public String generateName(String name) {
    checkName(name);
    names.add(name);
    int count = names.count(name);
    if (count == 1) {
      return name;
    }
    return name + collisionSeparator + (count - 1);
  }
818786
private String getAndAddUniqueShortName(String name) {
        // Capitalize the first letter of the name.
        String initCappedName = name.substring(0, 1).toUpperCase() + name.substring(1, name.length());
        // Make the short name all the capital letters in the long name.
        Matcher matcher = capitals.matcher(initCappedName);
        StringBuilder sbShortName = new StringBuilder();
        while(matcher.find()) {
            sbShortName.append(matcher.group());
        }
        String shortName = sbShortName.toString().toLowerCase();

        if (!shortNames.add(shortName)) {
            int i;
            for (i=0; i<10; i++) {
                String tmpsn = shortName + i;
                if (shortNames.add(tmpsn)) {
                    shortName = tmpsn;
                    break;
                }
            }
            if (i == 10) {
                throw new RuntimeException("Multiple options have the same short name: -" + shortName  + " (--" + name + ")");
            }
        }
        return shortName;
    }
954654
public static final UUID getUUID(InputStream is) throws IOException
   {
      byte[] data = new byte[16];
      is.read(data);

      long long1 = 0;
      long1 |= ((long) (data[3] & 0xFF)) << 56;
      long1 |= ((long) (data[2] & 0xFF)) << 48;
      long1 |= ((long) (data[1] & 0xFF)) << 40;
      long1 |= ((long) (data[0] & 0xFF)) << 32;
      long1 |= ((long) (data[5] & 0xFF)) << 24;
      long1 |= ((long) (data[4] & 0xFF)) << 16;
      long1 |= ((long) (data[7] & 0xFF)) << 8;
      long1 |= ((long) (data[6] & 0xFF)) << 0;

      long long2 = 0;
      long2 |= ((long) (data[8] & 0xFF)) << 56;
      long2 |= ((long) (data[9] & 0xFF)) << 48;
      long2 |= ((long) (data[10] & 0xFF)) << 40;
      long2 |= ((long) (data[11] & 0xFF)) << 32;
      long2 |= ((long) (data[12] & 0xFF)) << 24;
      long2 |= ((long) (data[13] & 0xFF)) << 16;
      long2 |= ((long) (data[14] & 0xFF)) << 8;
      long2 |= ((long) (data[15] & 0xFF)) << 0;

      return new UUID(long1, long2);
   }
40010
public static Identifier fromUuid(UUID uuid) {
        ByteBuffer buf = ByteBuffer.allocate(16);
        buf.putLong(uuid.getMostSignificantBits());
        buf.putLong(uuid.getLeastSignificantBits());
        return new Identifier(buf.array());
    }
131348
static final String createTag(final String name) {
		if (name.length() <= MAX_TAG_LEN) {
			return name;
		}

		final char[] tag = name.toCharArray();
		final int arrayLen = tag.length;
		int len = 0;
		int mark = 0;

		for (int i = 0; i < arrayLen; i++, len++) {
			if (tag[i] == '.') {
				len = mark;

				if (tag[len] != '.') {
					len++;
				}

				mark = len;

				if (i + 1 < arrayLen && tag[i + 1] != '.') {
					mark++;
				}
			}

			tag[len] = tag[i];
		}

		if (len > MAX_TAG_LEN) {
			int i = 0;

			mark--;

			for (int j = 0; j < len; j++) {
				if (tag[j] == '.' && ((j != mark) || (i >= MAX_TAG_LEN - 1))) {
					continue;
				}

				tag[i++] = tag[j];
			}

			len = i;

			if (len > MAX_TAG_LEN) {
				len = MAX_TAG_LEN;
			}
		}

		return new String(tag, 0, len);
	}
1110198
public synchronized @Nonnull TokenUuidAndPlainValue generateNewToken(@Nonnull String name) {
        // 16x8=128bit worth of randomness, using brute-force you need on average 2^127 tries (~10^37)
        byte[] random = new byte[16];
        RANDOM.nextBytes(random);
        String secretValue = Util.toHexString(random);
        String tokenTheUserWillUse = HASH_VERSION + secretValue;
        assert tokenTheUserWillUse.length() == 2 + 32;
        
        String secretValueHashed = this.plainSecretToHashInHex(secretValue);
        
        HashValue hashValue = new HashValue(HASH_VERSION, secretValueHashed);
        HashedToken token = HashedToken.buildNew(name, hashValue);
        
        this.addToken(token);
        
        return new TokenUuidAndPlainValue(token.uuid, tokenTheUserWillUse);
    }
786653
public UUID getId(String ksName, String cfName)
    {
        return cfIdMap.get(Pair.create(ksName, cfName));
    }
534529
public String getUuid() {
    if (StringUtil.isEmpty(this.uuid)) {
      this.uuid = UUID.randomUUID().toString().toLowerCase();
    }
    return this.uuid;
  }
503742
public static function uuid3(string $namespace, string $name): string
    {
        $bytes = static::getBytes($namespace);

        $hash = \md5($bytes . $name);

        return static::uuidFromHash($hash, 3);
    }
1040921
public static char getCorrespondingSymbol(String name) {
        Character symbol = (Character) map.get(name);
        if (symbol == null) {
            return (char)0;
        }
        return symbol.charValue();
    }
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;
    }
243959
public static String unshellifyName(String name) {
        if (Strings.isNotBlank(name)) {
            if (name.indexOf('-') >= 0 && name.toLowerCase().equals(name)) {
                String[] split = name.split("-");
                StringBuffer buffer = new StringBuffer();
                int idx = 0;
                for (String part : split) {
                    if (idx == 1) {
                        buffer.append(": ");
                    } else if (idx > 1) {
                        buffer.append(" ");
                    }
                    buffer.append(capitalize(part));
                    idx++;
                }
                return buffer.toString();
            }
        }
        return name;
    }
864986
public String getUuid()
  {
    LocalizationDefinition def = itemStream.getLocalizationDefinition();
    String uuid = null;
    if(def != null)
    {
      uuid = def.getUuid();
    }
    return uuid;
  }