Use same-algorithm factories for a locally selected hash provider
ProprietaryReplace known parameterless MD5 CSP or SHA Managed/CSP constructors assigned to a closed HashAlgorithm local, retaining its declared type and branch selection. Require every write to be a standalone assignment constructing a known provider and every read to be a BCL ComputeHash receiver. Retain control flow, allocation points, arguments and metadata; skip cleanup/state/reset, identity, escapes/captures, async/iterators, directives and snapshots. Opt-in modern-.NET compatibility; no algorithm or lifetime policy change.
OpenRewrite. Recipes. CSharp. Migration. Dotnet. Net6. UseAssignedHashAlgorithmFactoriesmod run . --recipe= OpenRewrite. Recipes. CSharp. Migration. Dotnet. Net6. UseAssignedHashAlgorithmFactoriesInstall it once, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.