Returns the UUID variant.
 Possible values:
 0b000 - Reserved, NCS backward compatibility.
 0b100 - The variant specified in this document.
 0b110 - Reserved, Microsoft Corporation backward compatibility.
 0b111 - Reserved for future definition.
967730
def variant
      variant_raw = (clock_seq_hi_and_reserved >> 5)
      result = nil
      if (variant_raw >> 2) == 0
        result = 0x000
      elsif (variant_raw >> 1) == 2
        result = 0x100
      else
        result = variant_raw
      end
      return (result >> 6)
    end
327704
def uuid4(self):
    """"""
    return ''.join([hexchars[self.randint(0,15)] for x in range(0,8)]) + '-' +\
           ''.join([hexchars[self.randint(0,15)] for x in range(0,4)]) + '-' +\
           '4'+''.join([hexchars[self.randint(0,15)] for x in range(0,3)]) + '-' +\
           uuid4special[self.randint(0,3)]+''.join([hexchars[self.randint(0,15)] for x in range(0,3)]) + '-' +\
           ''.join([hexchars[self.randint(0,15)] for x in range(0,12)])
169537
def get_OS_UUID(cls, os):
        
        if os in cls.templates:
            return cls.templates[os]

        uuid_regexp = '^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$'
        if re.search(uuid_regexp, os):
            return os

        raise Exception((
            "Invalid OS -- valid options are: 'CentOS 6.5', 'CentOS 7.0', "
            "'Debian 7.8', 'Debian 8.0' ,'Ubuntu 12.04', 'Ubuntu 14.04', 'Ubuntu 16.04', "
            "'Windows 2008', 'Windows 2012'"
        ))
97078
public PactDslJsonArray uuid() {
      generators.addGenerator(Category.BODY, rootPath + appendArrayIndex(1), UuidGenerator.INSTANCE);
      return uuid("e2490de5-5bd3-43d5-b7c4-526e33f71304");
    }
410052
public final SIBUuid12 getUuid()
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
    {
      SibTr.entry(tc, "getUuid");
      SibTr.exit(tc, "getUuid", _uuid);
    }
    return _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);
	}
677356
def uuid(self, version: int = None) -> str:
        
        bits = self.random.getrandbits(128)
        return str(uuid.UUID(int=bits, version=version))
310373
function validUUID(uuid) {
    // xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx where x is a hexadecimal digit and
    // y is 8,9, A, or B
    var uuidRegex = /^[0-9a-f]{8}\-[0-9a-f]{4}\-4[0-9a-f]{3}\-[89ab][0-9a-f]{3}\-[0-9a-f]{12}$/i,
        result;

    result = uuidRegex.exec(uuid);

    return result !== null;
}
764176
public static String getNewIfcGloballyUniqueId(){
		Guid guid = getGuidFromUncompressedString(UUID.randomUUID().toString());		
		String shortString = getCompressedStringFromGuid(guid);
		return shortString;
	}
942880
def _encode_uuid(name, value, dummy, opts):
    """"""
    uuid_representation = opts.uuid_representation
    # Python Legacy Common Case
    if uuid_representation == OLD_UUID_SUBTYPE:
        return b"\x05" + name + b'\x10\x00\x00\x00\x03' + value.bytes
    # Java Legacy
    elif uuid_representation == JAVA_LEGACY:
        from_uuid = value.bytes
        data = from_uuid[0:8][::-1] + from_uuid[8:16][::-1]
        return b"\x05" + name + b'\x10\x00\x00\x00\x03' + data
    # C# legacy
    elif uuid_representation == CSHARP_LEGACY:
        # Microsoft GUID representation.
        return b"\x05" + name + b'\x10\x00\x00\x00\x03' + value.bytes_le
    # New
    else:
        return b"\x05" + name + b'\x10\x00\x00\x00\x04' + value.bytes
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)
        );
    }
1212567
function stringToBinaryUUID(value) {
    // for compatiblity reason check if value is already converted...
    if (typeof value !== "string") {
        return value;
    }
    const hex = value.replace(/[{}-]/g, ""); // remove extra characters
    const buffer = new Buffer(hex, "hex");
    return new mongodb_1.Binary(buffer, mongodb_1.Binary.SUBTYPE_UUID);
}
501446
public static UUID getNext(UUID uuid) {
        checkArgument(uuid.version() == 1, "Not a time UUID");
        UUID max = maximumUuid();
        long lsb = uuid.getLeastSignificantBits();
        if (lsb < max.getLeastSignificantBits()) {
            return new UUID(uuid.getMostSignificantBits(), lsb + 1);
        }
        long timestamp = uuid.timestamp();
        if (timestamp < max.timestamp()) {
            return new UUID(getMostSignificantBits(timestamp + 1), minimumUuid().getLeastSignificantBits());
        }
        return null;  // No next exists since uuid == maximumUuid()
    }
707122
public static String uuid() {
		char[] uuid = new char[36];
		uuid[8] = uuid[13] = uuid[18] = uuid[23] = '-';
		for (int i = 0; i < 36; i++) {
			if (uuid[i] == 0) {
				uuid[i] = UUID.CHARS[UUID.randomInt(16)];
			}
		}
		return new String(uuid);
	}
1099206
public static function getUUID()
    {
        return sprintf('%04x%04x-%04x-%04x-%04x-%04x%04x%04x',
            // 32 bits for "time_low"
            mt_rand(0, 0xffff), mt_rand(0, 0xffff),

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

            // 16 bits for "time_hi_and_version",
            // four most significant bits holds version number 4
            mt_rand(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
            mt_rand(0, 0x3fff) | 0x8000,

            // 48 bits for "node"
            mt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0xffff)
        );
    }
1099015
def getICMByUUID(uuid: str):
    
    _metadata = ICMMetadata.query.filter_by(id=uuid).first().deserialize()
    del _metadata["model_id"]
    return jsonify(_metadata)
1146234
private static function uuid4()
    {
        $bytes =
            function_exists('openssl_random_pseudo_bytes')
                ? openssl_random_pseudo_bytes(16)
                : self::generateBytes(16);


        $hash = bin2hex($bytes);

        // Set the version number
        $timeHi = hexdec(substr($hash, 12, 4)) & 0x0fff;
        $timeHi &= ~(0xf000);
        $timeHi |= 4 << 12;

        // Set the variant to RFC 4122
        $clockSeqHi = hexdec(substr($hash, 16, 2)) & 0x3f;
        $clockSeqHi &= ~(0xc0);
        $clockSeqHi |= 0x80;

        $fields = [
            'time_low' => substr($hash, 0, 8),
            'time_mid' => substr($hash, 8, 4),
            'time_hi_and_version' => sprintf('%04x', $timeHi),
            'clock_seq_hi_and_reserved' => sprintf('%02x', $clockSeqHi),
            'clock_seq_low' => substr($hash, 18, 2),
            'node' => substr($hash, 20, 12),
        ];

        return vsprintf(
            '%08s-%04s-%04s-%02s%02s-%012s',
            $fields
        );
    }