UUID
Generates a UUID.
547829
function uuid() {
    var d = Date.now();
    // Use high perf timer if avail.
    /* istanbul ignore next */
    if (typeof performance !== 'undefined' && is_1.isFunction(performance.now))
        d += performance.now();
    return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
        var r = (d + Math.random() * 16) % 16 | 0;
        d = Math.floor(d / 16);
        return (c === 'x' ? r : (r & 0x3 | 0x8)).toString(16);
    });
}
1177855
function uuid4() {
	  var d = now();
	  var uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
	    var r = (d + Math.random() * 16) % 16 | 0;
	    d = Math.floor(d / 16);
	    return (c === 'x' ? r : (r & 0x7 | 0x8)).toString(16);
	  });
	  return uuid;
	}
956331
def log_uuid(self, uuid):
        
        #We only need to try and describe an object once; if it is already in
        #our database, then just move along.
        if uuid not in self.uuids and uuid in uuids:
            self.uuids[uuid] = uuids[uuid].describe()
247038
def uuid(self, type, val):
        """"""
        picker = lambda x: x.get('uuid', x)
        return self._get((type, val), picker)
513030
public static final UUID parseUUID(String value)
   {
      return value == null || value.isEmpty() ? null : UUID.fromString(value);
   }
696564
public static UUID fastUUID() {
		ThreadLocalRandom random = ThreadLocalRandom.current();
		return new UUID(random.nextLong(), random.nextLong());
	}
93583
def uuid(cls):
        """"""
        if hasattr(cls, '__uuid_primary_key__') and cls.__uuid_primary_key__:
            return synonym('id')
        else:
            return immutable(Column(UUIDType(binary=False), default=uuid_.uuid4, unique=True, nullable=False))
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);
	}
1234185
def prepare_uuid(data, schema):
    
    if isinstance(data, uuid.UUID):
        return str(data)
    else:
        return data
147443
public void sortedUUIDGenerator(String name, Integer sortedLength, Integer uuidLength) {
		checkReadOnly();
		DialectException.assureNotNull(name);
		if (this.getIdGenerator(GenerationType.SORTED_UUID, name) != null)
			throw new DialectException("Duplicated sortedUUIDGenerator name '" + name + "'");
		idGenerators.add(new SortedUUIDGenerator(name, sortedLength, uuidLength));
	}
212039
function uuids (count, callback) {
    if (typeof count === 'function') {
      callback = count
      count = 1
    }
    return relax({ method: 'GET', path: '_uuids', qs: { count: count } }, callback)
  }
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());
    }
177026
static protected function uuid()
		{
			// Use the random or the server name (if present) in the generation of UUID
			$base = md5(uniqid(rand(), true));

			// Mark as "random" UUID, set version
			$byte = hexdec( substr ($base, 12, 2));
			$byte = $byte & hexdec('0F');
			$byte = $byte | hexdec('40');
			$base = substr_replace($base, strtoupper (dechex ($byte)), 12, 2);

			// Set the variant
			$byte = hexdec (substr ($base, 16, 2));
			$byte = $byte & hexdec('3F');
			$byte = $byte | hexdec('80');
			$base = substr_replace($base, strtoupper (dechex ($byte)), 16, 2);

			// Format
			return strtolower(sprintf('%s-%s-%s-%s-%s', substr($base, 0, 8),	substr($base, 8, 4), substr($base, 12, 4), substr($base, 16, 4), substr($base, 20, 12)));
		}
1240760
def field_uuid(self, attr, options):
        """"""
        options['validators'].append(validators.UUIDValidator(attr.entity))
        return wtf_fields.StringField, options
685316
function fromNobleUuid(uuid) {
	if (uuid.length !== 32) return uuid;
	return (
		uuid.substring(0, 8) +
		'-' +
		uuid.substring(8, 12) +
		'-' +
		uuid.substring(12, 16) +
		'-' +
		uuid.substring(16, 20) +
		'-' +
		uuid.substring(20)
	);
}
480346
public static UUID fromString(String name) {
		String[] components = name.split("-");
		if (components.length != 5) {
			throw new IllegalArgumentException("Invalid UUID string: " + name);
		}
		for (int i = 0; i < 5; i++) {
			components[i] = "0x" + components[i];
		}

		long mostSigBits = Long.decode(components[0]).longValue();
		mostSigBits <<= 16;
		mostSigBits |= Long.decode(components[1]).longValue();
		mostSigBits <<= 16;
		mostSigBits |= Long.decode(components[2]).longValue();

		long leastSigBits = Long.decode(components[3]).longValue();
		leastSigBits <<= 48;
		leastSigBits |= Long.decode(components[4]).longValue();

		return new UUID(mostSigBits, leastSigBits);
	}
127619
function UUIDcreatePart (length) {
    var uuidpart = '';
    for (var i = 0; i < length; i++) {
        var uuidchar = parseInt((Math.random() * 256), 10).toString(16);
        if (uuidchar.length === 1) {
            uuidchar = '0' + uuidchar;
        }
        uuidpart += uuidchar;
    }
    return uuidpart;
}