Use the default RNG factory in a closed plain local

Proprietary

Replace a parameterless RNGCryptoServiceProvider plain local with RandomNumberGenerator.Create(), retaining the original lifetime and every bound byte-array fill call. Support inferred and explicit provider types; skip escapes, configuration, captures, async/iterators, initialization, cleanup and conditional snapshots. Opt-in modern-.NET compatibility port; no algorithm strengthening.

OpenRewrite.Recipes.CSharp.Migration.Dotnet.Net6.UseClosedRandomNumberGeneratorLocalFactory
mod run . --recipe=OpenRewrite.Recipes.CSharp.Migration.Dotnet.Net6.UseClosedRandomNumberGeneratorLocalFactory

Install it once, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.