internal static long GetEntropy()
{
lock (lockObj)
{
long ret;
if (currentIndex == bufferSize)
{
if (null == rng)
{
rng = RandomNumberGenerator.Create();
data = new byte[bufferSize];
Debug.Assert(bufferSize % 8 == 0, "We increment our current index by 8, so our buffer size must be a multiple of 8");
}
rng.GetBytes(data);
currentIndex = 0;
}
ret = BitConverter.ToInt64(data, currentIndex);
currentIndex += 8;
return ret;
}
}
#endif // FEATURE_RANDOMIZED_STRING_HASHING