Retrieves a newly generated random long.

@return A newly generated random long
430150
public static long getRandomLong() {
        byte[] rndBytes = new byte[8];
        SECURE_RANDOM_TL.get().nextBytes(rndBytes);
        return ByteBuffer.wrap(rndBytes).getLong();
    }
872391
public final BigInteger getUlong64() {
        final long long64 = getLong64();

        return (long64 >= 0) ? BigInteger.valueOf(long64) : BIGINT_MAX_VALUE.add(BigInteger.valueOf(1 + long64));
    }
1159836
protected long getLong()
  {
    if (tc.isEntryEnabled()) Tr.entry(tc, "getLong",this);

    long data = _buffer.getLong();

    if (tc.isEntryEnabled()) Tr.exit(tc, "getLong", new Long(data));
    return data;
  }
1349653
public Random getNewRandomInstance(long seed) {
        try {
            Random t = (Random) randomClass.newInstance();
            if (t.getStatePointer() != null) {
                // TODO: attach this thing to deallocator
                // if it's stateless random - we just don't care then
            }
            t.setSeed(seed);
            return t;
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
335449
public Long asLongObj() {
		if (current == null)
			return null;
		if (current instanceof Number) {
			if (current instanceof Long)
				return (Long) current;
			if (current instanceof Integer)
				return Long.valueOf(((Number) current).longValue());
			return null;
		}
		return null;
	}
1089749
public String getRandomText(final int minLength, final int maxLength) {
    validateMinMaxParams(minLength, maxLength);

    StringBuilder sb = new StringBuilder(maxLength);
    int length = minLength;
    if (maxLength != minLength) {
      length = length + random.nextInt(maxLength - minLength);
    }
    while (length > 0) {
      if (sb.length() != 0) {
        sb.append(" ");
        length--;
      }
      final double desiredWordLengthNormalDistributed = 1.0 + Math.abs(random.nextGaussian()) * 6;
      int usedWordLength = (int) (Math.min(length, desiredWordLengthNormalDistributed));
      String word = getRandomWord(usedWordLength);
      sb.append(word);
      length = length - word.length();
    }
    return sb.toString();

  }
809591
public static double nextDouble()
  {
    Random random = getRandom();

    double value = random.nextDouble();

    if (! _isTest)
      _freeRandomList.free(random);

    return value;
  }
1203818
public String get() {
		synchronized (LOCK) {
			if (!initialised) {
				// generate the random number
				Random rnd = new Random();	// @todo need a different seed, this is now time based and I
				// would prefer something different, like an object address
				// get the random number, instead of getting an integer and converting that to base64 later,
				// we get a string and narrow that down to base64, use the top 6 bits of the characters
				// as they are more random than the bottom ones...
				rnd.nextBytes(value);		// get some random characters
				value[3] = BASE64[((value[3] >> 2) & BITS_6)]; // NOSONAR
				value[4] = BASE64[((value[4] >> 2) & BITS_6)]; // NOSONAR
				value[5] = BASE64[((value[5] >> 2) & BITS_6)]; // NOSONAR
				value[6] = BASE64[((value[6] >> 2) & BITS_6)]; // NOSONAR
				value[7] = BASE64[((value[7] >> 2) & BITS_6)]; // NOSONAR

				// complete the time part in the HIGH value of the token
				// this also sets the initial low value
				completeToken(rnd);

				initialised = true;
			}

			// fill in LOW value in id
			int l = low;
			value[0] = BASE64[(l & BITS_6)];
			l >>= SHIFT_6;
			value[1] = BASE64[(l & BITS_6)];
			l >>= SHIFT_6;
			value[2] = BASE64[(l & BITS_6)];

			String res = new String(value);

			// increment LOW
			low++;
			if (low == LOW_MAX) {
				low = 0;
			}
			if (low == lowLast) {
				time = System.currentTimeMillis();
				completeToken();
			}

			return res;
		}
	}
1148294
public static synchronized String generateKey() {
		String code = "";

		long nr = System.currentTimeMillis();
		if (nr <= lastnr) {
			nr = lastnr + 1;
		}
		lastnr = nr;
		String s = String.valueOf(nr);
		for (int i = 0; i < s.length(); i++) {
			code += codeArray[randomizer.nextInt(6)][s.charAt(i) - 48];
		}
		return code;
	}
499298
public static String getRandomPasswordString(final int stringLength) {

    StringBuilder stringBuilder = getStringBuild();
    for (int i = 0; i < stringLength; i++) {
      stringBuilder.append(getRandomPasswordChar());
    }
    return stringBuilder.toString();
  }
987872
public long numBits() {
		return values.size64() * 2 + count.length * Long.SIZE + offset.length * (long)Long.SIZE + seed.length * (long)Long.SIZE;
	}
812562
public static Crypt getRandomCrypt() {
	  String lCypher=generateRandomKey(32);
	  String lSalt=generateRandomKey(8);
	  Crypt result=new Crypt(lCypher,lSalt);
	  return result;
	}
466913
@SuppressWarnings("NumericOverflow")
    private static long nextLong(long n) {
        long bits, val;
        do {
            bits = ThreadLocalRandom.current().nextLong() & (~(1L << BITS_PER_LONG));
            val = bits % n;
        } while (bits - val + (n - 1) < 0L);
        return val;
    }
1144590
public long getLong() {
        return ((long) (_buffer[_offset++] & 0xff) << 56 | (long) (_buffer[_offset++] & 0xff) << 48
                | (long) (_buffer[_offset++] & 0xff) << 40 | (long) (_buffer[_offset++] & 0xff) << 32
                | (long) (_buffer[_offset++] & 0xff) << 24 | (long) (_buffer[_offset++] & 0xff) << 16
                | (long) (_buffer[_offset++] & 0xff) << 8 | (long) (_buffer[_offset++] & 0xff));
    }
1193535
public static final long getLong(InputStream is) throws IOException
   {
      byte[] data = new byte[8];
      is.read(data);
      return getLong(data, 0);
   }
594393
private long getRndPositiveLong() {
  	   	long rnd = Long.MIN_VALUE;
  	   	while (rnd == Long.MIN_VALUE) {
  	  	   	rnd = staticRandomGenerator.nextLong();
  	   	}
    	return Math.abs(rnd);
    }
416248
public static long randomLongLessThan(long maxExclusive) {
    checkArgument(
        maxExclusive > Long.MIN_VALUE, "Cannot produce long less than %s", Long.MIN_VALUE);
    return randomLong(Long.MIN_VALUE, maxExclusive);
  }