Use the same hash factory in a using block with terminal cleanup

Proprietary

Replace parameterless MD5 CSP or SHA Managed/CSP construction in a parenthesized using block with its same-algorithm factory when all object references are BCL ComputeHash or direct terminal Clear/Dispose calls. Retain explicit cleanup and using disposal, repeated hashes and argument evaluation. Skip post-cleanup hashing, nested cleanup, identity, state reads, escapes, captures, async/iterators and conditional snapshots. Opt-in modern-.NET compatibility port; no algorithm or format change.

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

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