Use static random fill for an inline provider and fresh array
ProprietaryReplace a parameterless BCL new RNGCryptoServiceProvider().GetBytes(byte[]) ignored call immediately after a fresh explicit byte[] local allocation with typed RandomNumberGenerator.Fill. Retain allocation, identity and following consumers. Skip unknown/shared buffers, nonzero/ranged/other calls, configured constructors, comments, captures/ref/unsafe/async and conditional snapshots. Opt-in modern API port; no random algorithm, size, seed or ownership policy is selected.
OpenRewrite. Recipes. CSharp. Migration. Dotnet. Net6. UseClosedInlineRandomFillmod run . --recipe= OpenRewrite. Recipes. CSharp. Migration. Dotnet. Net6. UseClosedInlineRandomFillInstall it once, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.