Use the default RNG factory in an existing using declaration

Proprietary

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

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

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