Skip to content

Commit 2c5a1b7

Browse files
committed
Use RNG instead
1 parent 20cc3cc commit 2c5a1b7

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

.editorconfig

-3
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,6 @@ dotnet_diagnostic.CA1056.severity = none # CA1056: Uri properties should not be
446446
dotnet_diagnostic.CA1812.severity = none # CA1812: Avoid uninstantiated internal classes
447447
dotnet_diagnostic.CA2201.severity = suggestion # CA2201: Do not raise reserved exception types
448448
dotnet_diagnostic.CA2227.severity = suggestion # CA2227: Collection properties should be read only
449-
dotnet_diagnostic.CA5394.severity = none # CA5394 : Random is an insecure random number generator.
450449

451450
# SonarAnalyzer.CSharp
452451
# https://rules.sonarsource.com/csharp
@@ -466,8 +465,6 @@ dotnet_diagnostic.BL0005.severity = none
466465
dotnet_diagnostic.BL0006.severity = none
467466
dotnet_diagnostic.BL0007.severity = none
468467

469-
dotnet_diagnostic.CA5394.severity = none # CA5394 : Random is an insecure random number generator.
470-
471468
##########################################
472469
# Custom Test Code Analyzers Rules
473470
##########################################

src/LinkDotNet.Blog.Web/Features/Components/ObjectNotFound.razor

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
@using System.Security.Cryptography
12
<div class="m-auto text-center">
23
<h1 class="fs-1">404 - o((⊙﹏⊙))o</h1>
34
<br />
@@ -84,7 +85,7 @@
8485
}
8586

8687
remainingGuesses = maxGuesses;
87-
targetNumber = Random.Shared.Next(1, maxNumber + 1);
88+
targetNumber = RandomNumberGenerator.GetInt32(1, maxNumber + 1);
8889
}
8990

9091
private void CheckGuess()

0 commit comments

Comments
 (0)