We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ee0587e commit e571eb3Copy full SHA for e571eb3
src/CommunityToolkit.Mvvm.SourceGenerators/Helpers/HashCode.cs
@@ -35,7 +35,10 @@ private static unsafe uint GenerateGlobalSeed()
35
{
36
byte[] bytes = new byte[4];
37
38
- RandomNumberGenerator.Create().GetBytes(bytes);
+ using (RandomNumberGenerator generator = RandomNumberGenerator.Create())
39
+ {
40
+ generator.GetBytes(bytes);
41
+ }
42
43
return BitConverter.ToUInt32(bytes, 0);
44
}
@@ -182,4 +185,4 @@ private static uint RotateLeft(uint value, int offset)
182
185
183
186
return (value << offset) | (value >> (32 - offset));
184
187
-}
188
+}
0 commit comments