Generate and return a cryptographically-secure short random string
        of the specified length.
488851
def random(self, length=22):
        
        random_num = int(binascii.b2a_hex(os.urandom(length)), 16)
        return self._num_to_string(random_num, pad_to_length=length)[:length]
13812
function randomBytesSync (size) {
  var err = null

  for (var i = 0; i < GENERATE_ATTEMPTS; i++) {
    try {
      return crypto.randomBytes(size)
    } catch (e) {
      err = e
    }
  }

  throw err
}
288203
def _make_random_string(length):
    
    chars = string.ascii_lowercase + string.ascii_uppercase + string.digits
    return ''.join(random.choice(chars) for x in range(length))
348753
def rand_hexstr(length, lower=True):
    
    if lower:
        return rand_str(length, allowed=CHARSET_HEXSTR_LOWER)
    else:
        return rand_str(length, allowed=CHARSET_HEXSTR_UPPER)
562786
public static String generateCharsSymbolsString(int lenght) {
        StringBuffer buf = new StringBuffer(lenght);
        SecureRandom rand = new SecureRandom();
        for (int i = 0; i < lenght; i++) {
            buf.append(charsSymbols[rand.nextInt(charsSymbols.length)]);
        }
        return buf.toString();
    }
624306
function randomValueHex(len) {
    return crypto
        .randomBytes(Math.ceil(len / 2))
        .toString('hex')
        .slice(0, len)
        .toUpperCase();
}
765029
def random_string(length, charset):
    
    n = len(charset)
    return ''.join(charset[random.randrange(n)] for _ in range(length))
622864
def random(self, length=None):
        
        if length is None:
            length = self._length

        random_num = int(binascii.b2a_hex(os.urandom(length)), 16)
        return int_to_string(random_num, self._alphabet, padding=length)[:length]
558987
function generateRandomId (length) {
  var str = ''
  length = length || 6
  while (str.length < length) {
    str += (((1 + Math.random()) * 0x10000) | 0).toString(16)
  }
  return str.substring(str.length - length, str.length)
}
66330
def generate_random_string(length=6):
    '''
    
    '''
    n = int(length / 2 + 1)
    x = binascii.hexlify(os.urandom(n))
    s = x[:length]
    return s.decode('utf-8')
140195
def random_hex(length):
    
    charset = ''.join(set(string.hexdigits.lower()))
    return random_string(length, charset)
573035
function quickRandom(length) {
    length = length || 16;
    var pool = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';

    return str_shuffle(pool.repeat(5)).substr(0, length);
}
1334960
def random_str(size=10):
    
    return ''.join(random.choice(string.ascii_lowercase) for _ in range(size))
871834
function generateRandomString(length) {
	let s = "";
	let i = length;
	while (length-- > 0) {
		let c = Math.floor(Math.random() * (MAX_HEX_SYMBOL - MIN_HEX_SYMBOL + 1)) + MIN_HEX_SYMBOL;
		c = c.toString(16).toLowerCase();
		s += c;
	}
	return s;
}
807389
public static String randomString(int length) {
        // CAUSE: If-Else Statements Should Use Braces
        if (length < 1) {
            throw new IllegalArgumentException(String.format("length < 1: %s", length));
        }

		char[] buf = new char[length];

		return nextString(buf);
	}
1176919
function createRandomStr(length) {
  const bag = 'abcdefghijklmnopqrstuvwxyz0123456789';
  let generated = '';
  for (let i = 0; i < length; i++) {
    generated += bag[Math.floor(Math.random() * bag.length)];
  }
  return generated;
}
10717
public static String randomString(int length) {
	StringBuilder sb = new StringBuilder();
	for (int i = 0; i < length; i++) {
	    sb.append(chars[AbstractCaptcha.rnd(0, chars.length - 1)]);
	}
	return sb.toString();
    }