Use modern hash factories for SHA CSP locals used once
ProprietaryReplace a parameterless SHA1/SHA256/SHA384/SHA512CryptoServiceProvider local used once by an immediately following ComputeHash return, initializer, plain local assignment or discarded call with the same algorithm's modern Create() factory. Modern .NET wraps the same hash provider. Preserve argument evaluation and the ComputeHash overload. Leave escaping/reused providers, CNG classes, settings, disposal scopes, fallback factories, async/iterator blocks and conditional snapshots unchanged. Opt-in; no algorithm upgrade.
OpenRewrite. Recipes. CSharp. Migration. Dotnet. Net6. UseImmediateShaCspHashFactorymod run . --recipe= OpenRewrite. Recipes. CSharp. Migration. Dotnet. Net6. UseImmediateShaCspHashFactoryInstall it once, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.