目前,我在我的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