Use the same hash factory for a local used once

Proprietary

Replace a parameterless MD5CryptoServiceProvider or SHA1/SHA256/SHA384/SHA512Managed local used once by an immediately following ComputeHash return, initializer, plain local assignment or discarded call with the same algorithm's modern Create() factory. Preserve the ComputeHash overload and argument evaluation. Do not strengthen algorithms or replace stateful/escaped providers, settings, disposal scopes, fallback logic, async/iterator blocks or conditional snapshots. Opt-in modern-.NET migration.

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

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