This method returns new onject implementing Random interface, initialized with seed value, with size of elements in buffer

@param seed rng seed
@param size size of underlying buffer
@return object implementing Random interface
494070
public Random getNewRandomInstance(long seed, long size) {
        try {
            Class<?> c = randomClass;
            Constructor<?> constructor = c.getConstructor(long.class, long.class);
            Random t = (Random) constructor.newInstance(seed, size);
            return t;
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
481832
private SecureRandom createSecureRandom() {
        SecureRandom result;
        try {
            result = SecureRandom.getInstance("SHA1PRNG");
        } catch (NoSuchAlgorithmException e) {
            result = new SecureRandom();
        }

        // Force seeding to take place.
        result.nextInt();
        return result;
    }
510434
@Nullable
  private EventExecutorGroup createEventExecutorGroup(int size) {
    if (size <= 0) {
      return null;
    }

    ThreadFactory threadFactory = new ThreadFactory() {
      private final ThreadGroup threadGroup = new ThreadGroup(serviceName + "-executor-thread");
      private final AtomicLong count = new AtomicLong(0);

      @Override
      public Thread newThread(Runnable r) {
        Thread t = new Thread(threadGroup, r, String.format("%s-executor-%d", serviceName, count.getAndIncrement()));
        t.setDaemon(true);
        return t;
      }
    };

    UnorderedThreadPoolEventExecutor executor = new UnorderedThreadPoolEventExecutor(size, threadFactory,
                                                                                     rejectedExecutionHandler);
    if (execThreadKeepAliveSecs > 0) {
      executor.setKeepAliveTime(execThreadKeepAliveSecs, TimeUnit.SECONDS);
      executor.allowCoreThreadTimeOut(true);
    }
    return new NonStickyEventExecutorGroup(executor);
  }
964273
public long initMathRandom(final Long seed) {
		if (seed == null) {
			mathRandom = new MathRandom();
		} else {
			mathRandom = new MathRandom(seed);
		}
		return mathRandom.getSeed();
	}
1042332
public static NKey fromSeed(char[] seed) {
        DecodedSeed decoded = decodeSeed(seed); // Should throw on bad seed

        if (decoded.bytes.length == ED25519_PRIVATE_KEYSIZE) {
            return new NKey(Type.fromPrefix(decoded.prefix), null, seed);
        } else {
            try {
                return createPair(Type.fromPrefix(decoded.prefix), decoded.bytes);
            } catch (Exception e) {
                throw new IllegalArgumentException("Bad seed value", e);
            }
        }
    }
412685
synchronized public void setSeed(final long seed)
        {
        // Due to a bug in java.util.Random clear up to 1.2, we're
        // doing our own Gaussian variable.
        __haveNextNextGaussian = false;

        mt = new int[N];
        
        mag01 = new int[2];
        mag01[0] = 0x0;
        mag01[1] = MATRIX_A;

        mt[0]= (int)(seed & 0xffffffff);
        for (mti=1; mti<N; mti++) 
            {
            mt[mti] = 
                (1812433253 * (mt[mti-1] ^ (mt[mti-1] >>> 30)) + mti); 
            /* See Knuth TAOCP Vol2. 3rd Ed. P.106 for multiplier. */
            /* In the previous versions, MSBs of the seed affect   */
            /* only MSBs of the array mt[].                        */
            /* 2002/01/09 modified by Makoto Matsumoto             */
            mt[mti] &= 0xffffffff;
            /* for >32 bit machines */
            }
        }
335344
public static int[] randomPermutation(int size) {
        Random r = new Random();
        int[] result = new int[size];

        for (int j = 0; j < size; j++) {
            result[j] = j;
        }
        
        for (int j = size - 1; j > 0; j--) {
            int k = r.nextInt(j);
            int temp = result[j];
            result[j] = result[k];
            result[k] = temp;
        }

        return result;
    }
332866
public static CipherUtil buildInstance(Algorithms algorithms, String seed, int keySize) {
        String id = (algorithms.name() + seed + keySize).intern();
        SecretKey key = KEY_CACHE.compute(id, (k, v) -> {
            if (v == null) {
                return KeyTools.buildKey(algorithms, seed, keySize);
            } else {
                return v;
            }
        });
        return buildInstance(algorithms, key.getEncoded());
    }
145025
@SuppressWarnings("unchecked")
    public static ByteBuffer allocateDirectBuffer(int size) {
        try {
            Class<?> cls = Class.forName("java.nio.DirectByteBuffer");
            Constructor<?> constructor = cls.getDeclaredConstructor(Long.TYPE, Integer.TYPE);
            constructor.setAccessible(true);
            Field cleanerField = cls.getDeclaredField("cleaner");
            cleanerField.setAccessible(true);
            final long memory = allocateMemory(size);
            ByteBuffer buffer = (ByteBuffer) constructor.newInstance(memory, size);
            Cleaner cleaner = Cleaner.create(buffer, new Runnable() {
                @Override
                public void run() {
                    freeMemory(memory);
                }
            });
            cleanerField.set(buffer, cleaner);
            return buffer;
        } catch (Exception e) {
            throwException(e);
        }
        throw new IllegalStateException("unreachable");
    }
219029
public static <K, V> HashMap<K, V> newHashMap(int size) {
		return newHashMap(size, false);
	}
628622
public static final ISID createRandom (final long seed) {

        // TODO: Implement Qualifier
        final Random rand = new Random(seed);

        final ISID isid = new ISID(Format.RANDOM, Constants.RESERVED_BYTE, (short) rand.nextInt(), (byte) rand.nextInt(), (short) 0);

        return isid;
    }
437868
def random_integers(cls, size, seed=None):
        
        if seed is None:
            seed = abs(hash("%0.20f" % time.time())) % (2 ** 31)
        return cls.from_sequence(size).hash(seed)
277303
public static void randomPathFast(int[] result, int size) {
        //Random generator = new Random();

        for (int i = 0; i < size; i++) result[i] = i;
        for (int k = size - 1; k > 0; k--) {
            int w = (int)Math.floor(Math.random() * (k+1));
            int temp = result[w];
            result[w] = result[k];
            result[k] = temp;
        }
    }
402646
public KeyPair getRandomKeyPair(int keySize){  
        KeyPairGenerator pairgen;
		try {
			pairgen = KeyPairGenerator.getInstance(algorithm);
			SecureRandom random = new SecureRandom();  
	        pairgen.initialize(keySize, random);  
	        return pairgen.generateKeyPair();
		} catch (Exception e) {
			log.error(e.getMessage(),e);
		}  
        return null;  
    }
114576
function(seed) {
    if (!values.isNumber(seed)) {
        throw errors.typeErrorFunction('Math.seed', 'number', seed);
    }
    _random = seedrandom(seed);
    return null;
}
971983
public static IntStream buildRandomIntStream(int streamSize,
            long seed, int exclusiveBound) {
        return buildRandomIntStream(streamSize, new Random(seed),
                exclusiveBound);
    }
411656
function randomArray(size) {
	const cache = arrayCaches[size];
	return cache[Math.floor(Math.random() * cache.length)];
}