目前,我在我的UWP应用什么是.NETCore中CryptoConfig类的替换?
byte[] bytes = new UTF8Encoding().GetBytes(Password);
byte[] hash = ((HashAlgorithm)CryptoConfig.CreateFromName("MD5")).ComputeHash(bytes);
string hashstring = BitConverter.ToString(hash);
我寻觅了很多,但无法找到.NETCore更换CryptoConfig类的事情了。
这几乎总是,但并非完全如此,如果你正在访问CryptoConfig,那么你做错了什么。具有构造函数(如HMACSHA256)的算法应直接构建,抽象的算法(如RSA)应通过其Create方法实例化。 (虽然HashAlgorithm是抽象的,并有一个Create方法,不要使用那个...它不是一个特定的算法,所以你不知道你在干什么) – bartonjs