Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [ThreadStatic]
- private static byte[] _threadSafeTempByteBuffer;
- /* later */
- byte[] tempBytes = _threadSafeTempByteBuffer;
- if (tempBytes == null)
- {
- tempBytes = _threadSafeTempByteBuffer = new byte[sizeof(uint)];
- }
- do
- {
- rng.GetBytes(tempBytes);
- result = mask & Convert.ToUInt32(tempBytes);
- } while (result > range);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement