Make an id in the format of UUID4, but keep in mind this could very well be pseudorandom, and if it is you'll not be truely random, and can regenerate same id if same seed
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)])
727000
public static String createUniqueIdentifier() {
		String id;
		do {
			id = UUID.randomUUID().toString();
		} while (getSREFromId(id) != null);
		return id;
	}
808116
def create_id(self, prefix="guid"):
        
        if self.method == IDGenerator.METHOD_UUID:
            id_ = str(uuid.uuid4())
        elif self.method == IDGenerator.METHOD_INT:
            id_ = self.next_int
            self.next_int += 1
        else:
            raise InvalidMethodError(self.method)

        return "%s:%s-%s" % (self.namespace.prefix, prefix, id_)
285399
def acts_as_random_id(options={:field => :id}, &block)
      before_create do |record|
        if block
          record.ensure_unique_id(options, &block)
        else
          record.ensure_unique_id(options) do
            rand(2_147_483_647) + 1 # mysql and SQLite type integer
          end
        end
      end
    end
677356
def uuid(self, version: int = None) -> str:
        
        bits = self.random.getrandbits(128)
        return str(uuid.UUID(int=bits, version=version))
672046
function KdbxUuid(ab) {
    if (ab === undefined) {
        ab = new ArrayBuffer(UuidLength);
    }
    if (typeof ab === 'string') {
        ab = ByteUtils.base64ToBytes(ab);
    }
    this.id = ab.byteLength === 16 ? ByteUtils.bytesToBase64(ab) : undefined;
    this.empty = true;
    if (ab) {
        var bytes = new Uint8Array(ab);
        for (var i = 0, len = bytes.length; i < len; i++) {
            if (bytes[i] !== 0) {
                this.empty = false;
                return;
            }
        }
    }
}
1029190
def generate_id():
    """"""
    # TODO: Use six.string_type to Py3 compat
    try:
        return unicode(uuid1()).replace(u"-", u"")
    except NameError:
        return str(uuid1()).replace(u"-", u"")
295990
def _uniqueid(n=30):
    
    return ''.join(random.SystemRandom().choice(
                   string.ascii_uppercase + string.ascii_lowercase)
                   for _ in range(n))
556966
def _random_id(self, size=16, chars=string.ascii_uppercase + string.digits):
        
        return ''.join(random.choice(chars) for _ in range(size))
974527
def uuid(self, value):
        """"""
        if value is not None:
            self.keystore['id'] = value
        elif 'id' in self.keystore:
            self.keystore.pop('id')
1186395
public String getUUID()
    {
    	StringBuilder uuid = new StringBuilder(36);
        int i = (int)System.currentTimeMillis();
        int j = seed.nextInt();
        hexFormat(i,uuid);
        uuid.append(fixedPart);
        hexFormat(j,uuid);        
        return uuid.toString();
    }
745496
public static function generateUUID() :string
    {
        return sprintf(
            '%04x%04x-%04x-%04x-%04x-%04x%04x%04x',
            mt_rand(0, 0xffff),
            mt_rand(0, 0xffff),
            mt_rand(0, 0xffff),
            mt_rand(0, 0x0fff) | 0x4000,
            mt_rand(0, 0x3fff) | 0x8000,
            mt_rand(0, 0xffff),
            mt_rand(0, 0xffff),
            mt_rand(0, 0xffff)
        );
    }
1298201
function uuid() {
  return ([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g, c =>
    (c ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> c / 4).toString(16)
  )
}
246230
function genUID(len){
    function base36(val){
      return Math.round(val).toString(36);
    }

    // uid should starts with alpha
    var result = base36(10 + 25 * Math.random());

    if (!len)
      len = 16;

    while (result.length < len)
      result += base36(new Date * Math.random());

    return result.substr(0, len);
  }
407396
public function randomId($random_id_length = 10)
    {
        //generate a random id encrypt it and store it in $rnd_id 
        $rnd_id = crypt(uniqid(rand(), 1), uniqid(rand(), 1));

        //to remove any slashes that might have come 
        $rnd_id = strip_tags(stripslashes($rnd_id));

        //Removing any . or / and reversing the string 
        $rnd_id = strrev(str_replace("/", "", str_replace(".", "", $rnd_id)));

        if (strlen($rnd_id) < $random_id_length) {
            $rnd_id = $rnd_id . $this->randomId($random_id_length - strlen($rnd_id));
        }

        //finally I take the first 10 characters from the $rnd_id 
        $rnd_id = substr($rnd_id, 0, $random_id_length);
        $this->BackyardError->log(5, "Random id is " . $rnd_id, array(16));
        return $rnd_id;
    }
372545
def get_random_id(length):
    """"""
    alphabet = string.ascii_uppercase + string.ascii_lowercase + string.digits
    return ''.join(random.choice(alphabet) for _ in range(length))
622299
def generate_id
      Base64.encode64(
        Digest::MD5.digest("#{Time.now}-#{rand}")
      ).gsub('/','x').gsub('+','y').gsub('=','').strip
    end