static internal HashAlgorithm CreateFromName(string name) { #if FULL_AOT_RUNTIME switch (name) { case "MD2": return(MD2.Create()); case "MD4": return(MD4.Create()); case "MD5": return(MD5.Create()); case "SHA1": return(SHA1.Create()); case "SHA256": return(SHA256.Create()); case "SHA384": return(SHA384.Create()); case "SHA512": return(SHA512.Create()); case "RIPEMD160": return(RIPEMD160.Create()); default: try { return((HashAlgorithm)Activator.CreateInstance(Type.GetType(name))); } catch { throw new CryptographicException("Unsupported hash algorithm: " + name); } } #else return(HashAlgorithm.Create(name)); #endif }
public new static MD2 Create() { return(MD2.Create(nameof(MD2))); }
public new static MD2 Create() { return(MD2.Create("MD2")); }