Returns random data using the Crypto API if available and Math.random if not
Method is from https://gist.github.com/jed/982883 like generateUUID, direct link https://gist.github.com/jed/982883#gistcomment-45104
971508
function _getRandomData() {
  if (window && window.crypto && window.crypto.getRandomValues) {
    return crypto.getRandomValues(new Uint8Array(1))[0] % 16;
  } else {
    return Math.random() * 16;
  }
}
490577
private String randomSecret() {
        byte[] r = new byte[32];
        new Random().nextBytes(r);
        return Base64.encodeToString(r, Base64.URL_SAFE | Base64.NO_WRAP | Base64.NO_PADDING);
    }
794904
function uuid() {
    var i, random;
    var uuid = '';

    for (i = 0; i < 32; i++) {
        random = Math.random() * 16 | 0;
        if (i === 8 || i === 12 || i === 16 || i === 20) {
            uuid += '-';
        }
        uuid += (i === 12 ? 4 : (i === 16 ? (random & 3 | 8) : random)).toString(16);
    }

    return uuid;
}
388273
def generate_random(number_of_bytes=None, region=None, key=None, keyid=None,
                    profile=None):
    '''
    
    '''
    conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)

    r = {}
    try:
        random = conn.generate_random(number_of_bytes)
        r['random'] = random['Plaintext']
    except boto.exception.BotoServerError as e:
        r['error'] = __utils__['boto.get_error'](e)
    return r
552671
def random(self, n: Optional[int] = None) -> Union[List[float], float]:
        
        randoms = []
        n_or_default = 1 if n is None else n

        for _ in range(n_or_default):
            number_of_digits = _RandintsToFloatOptions.RANDINTS_NUMBER_OF_DIGITS.value
            max_int = int('9' * number_of_digits)

            randints = self.randint(0, max_int, _RandintsToFloatOptions.RANDINTS_QUANTITY.value)
            zero_padded_ints = (str(randint).zfill(number_of_digits) for randint in randints)
            random = float(f"0.{''.join(zero_padded_ints)}")
            randoms.append(random)

        return randoms if n else randoms[0]
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);
	}
732606
def get_random_string():
    
    
    # set up a random string to associate with the run
    hash_string = "%8x" % random.getrandbits(32)
    hash_string = hash_string.strip()
    
    # done't allow the random strings to be equivalent to a number, since
    # the LSF cluster interprets those differently from letter-containing
    # strings
    while is_number(hash_string):
        hash_string = "%8x" % random.getrandbits(32)
        hash_string = hash_string.strip()
    
    return hash_string
697493
function createRandomData(count) {
  function rnd() {
    return Math.round(Math.random() * 1000) / 10;
  }
  var result = [];
  for (var i = 0; i < count; i++) {
    result.push({price:rnd(), weight:rnd(), taste:rnd()});
  }
  return result;
}
383726
def verify_security_data(security):
    
    random_token = security[TOKEN_RANDOM]
    hashed_token = security[TOKEN_HASHED]
    return str(hashed_token) == str(compute_token(random_token))
115521
function getBytes(len) {
    if (!len) {
        return new Uint8Array(0);
    }
    algo.getBytes(Math.round(Math.random() * len) + 1);
    var result = algo.getBytes(len);
    var cryptoBytes = CryptoEngine.random(len);
    for (var i = cryptoBytes.length - 1; i >= 0; --i) {
        result[i] ^= cryptoBytes[i];
    }
    return result;
}
344422
function () {
    return crypto.createHash('sha1')
        .update(Date.now().toString() + Math.random().toString())
        .digest('hex');
}
1294873
function random(array, len) {
  const size = array.length;
  const randomIndexes = crypto.randomBytes(len).toJSON().data;
  return randomIndexes.map((char) => array[char % size]).join('');
}
43841
def get_random_integer(N, randfunc=None):
    
    if randfunc is None:
        randfunc = Random.new().read

    S = randfunc(N>>3)
    odd_bits = N % 8
    if odd_bits != 0:
        char = ord(randfunc(1)) >> (8-odd_bits)
        S = bchr(char) + S
    value = bytes_to_long(S)
    return value
1331504
function _generateUUID() {
        var result,
            numericSeed;
        for (
            result = numericSeed = '';
            numericSeed++ < 36;
            result += numericSeed * 51 & 52 ? (numericSeed ^ 15 ? 8 ^ Math.random() * (numericSeed ^ 20 ? 16 : 4) : 4).toString(16) : '-'
        );

        return result;
    }
276402
function () {
            var rand = '' + Math.random() * 1000 * new Date().getTime();
            return rand.replace('.', '').split('').sort(function () {
                return 0.5 - Math.random();
            }).join('');
        }
1016423
protected function _generateUUID()
    {
        $data = null;
        switch (true) {
            case $this->_isCallable('random_bytes'):
                $data = $this->_randomBytes(16);
                break;
            case $this->_isCallable('openssl_random_pseudo_bytes'):
                $data = $this->_opensslRandomPseudoBytes(16);
                break;
            case $this->_isCallable('mt_rand'):
                $data = $this->_generateBytesWithMtRand(16);
                break;
            default:
                return 'unavailable';
        }

        return $this->_generateUUIDFromData($data);
    }
1243587
def _random_key(self):
        
        hashstr = '%s%s' % (random.random(), self.time_module.time())
        return hashlib.md5(hashstr).hexdigest()