Advertisement
Guest User

Untitled

a guest
Feb 21st, 2020
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. [ThreadStatic]
  2. private static byte[] _threadSafeTempByteBuffer;
  3.  
  4. /* later */
  5.  
  6. byte[] tempBytes = _threadSafeTempByteBuffer;
  7. if (tempBytes == null)
  8. {
  9. tempBytes = _threadSafeTempByteBuffer = new byte[sizeof(uint)];
  10. }
  11.  
  12. do
  13. {
  14. rng.GetBytes(tempBytes);
  15. result = mask & Convert.ToUInt32(tempBytes);
  16. } while (result > range);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement