Consider I have the following code:
public sealed class SimpleRandomProvider : IRandomProvider
{
private static readonly Lazy<Random> RandomHolder = new Lazy<Random>(() => new Random());
public void NextBytes(byte[] buffer)
{
RandomHolder.Value.NextBytes(buffer);
}
}
Unfortunately, everytime I call NextBytes
in System.Random
buffer
gets filled with empty bytes:
What is strange, first X
(about 100) calls of NextBytes
works just fine.
What is happening? May it be a bug in .Net Core?
Aucun commentaire:
Enregistrer un commentaire