File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
StandardSocketsHttpHandler Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -44,13 +44,14 @@ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
4444using System . Collections . Generic ;
4545using System . ComponentModel ;
4646using System . Runtime . CompilerServices ;
47+ using System . Security . Cryptography ;
4748
4849namespace System
4950{
5051 // xxHash32 is used for the hash code.
5152 // https://github.com/Cyan4973/xxHash
5253
53- public struct HashCode
54+ internal struct HashCode
5455 {
5556 private static readonly uint s_seed = GenerateGlobalSeed ( ) ;
5657
@@ -62,8 +63,9 @@ public struct HashCode
6263
6364 private static unsafe uint GenerateGlobalSeed ( )
6465 {
65- uint result ;
66- Interop . GetRandomBytes ( ( byte * ) & result , sizeof ( uint ) ) ;
66+ byte [ ] random = new byte [ 4 ] ;
67+ RandomNumberGenerator . Create ( ) . GetBytes ( random ) ;
68+ uint result = BitConverter . ToUInt32 ( random , 0 ) ;
6769 return result ;
6870 }
6971
You can’t perform that action at this time.
0 commit comments