Skip to content

Commit 91bb36d

Browse files
Add cryptographic security note to System.Random API docs (#12481)
* Initial plan * Add cryptographic security NOTE to System.Random type-level remarks Agent-Logs-Url: https://github.com/dotnet/dotnet-api-docs/sessions/864bf564-cbba-4176-b4fa-a901073a6b7c Co-authored-by: GrabYourPitchforks <1746272+GrabYourPitchforks@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: GrabYourPitchforks <1746272+GrabYourPitchforks@users.noreply.github.com>
1 parent 3b5e925 commit 91bb36d

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

xml/System/Random.xml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,14 @@
7474
</Attributes>
7575
<Docs>
7676
<summary>Represents a pseudo-random number generator, which is an algorithm that produces a sequence of numbers that meet certain statistical requirements for randomness.</summary>
77-
<remarks>For more information about this API, see <see href="/dotnet/fundamentals/runtime-libraries/system-random">Supplemental API remarks for Random</see>.</remarks>
77+
<remarks>
78+
<format type="text/markdown"><![CDATA[
79+
> [!NOTE]
80+
> To generate a cryptographically secure random number, such as one that's suitable for creating a random password, use one of the static methods in the <xref:System.Security.Cryptography.RandomNumberGenerator> class.
81+
82+
For more information about this API, see [Supplemental API remarks for Random](/dotnet/fundamentals/runtime-libraries/system-random).
83+
]]></format>
84+
</remarks>
7885
<example>
7986
<format type="text/markdown"><![CDATA[
8087
The following example creates a single random number generator and calls its <xref:System.Random.NextBytes*>, <xref:System.Random.Next*>, and <xref:System.Random.NextDouble*> methods to generate sequences of random numbers within different ranges.

0 commit comments

Comments
 (0)