我有一个加密用盐腌哈希密码的类。
但是如果我想空传递给该类我收到以下错误: Cannot implicitly convert type string to byte[]
下面是类代码:
public class MyHash
{
public static string ComputeHash(string plainText,
string hashAlgorithm, byte[] saltBytes)
{
Hash Code
}
}
当我使用类我得到的错误:“无法隐式转换string类型为byte []”
//Encrypt Password
byte[] NoHash = null;
byte[] encds = MyHash.ComputeHash(Password, "SHA256", NoHash);