私は塩漬けされたハッシュでパスワードを暗号化するクラスを持っています。暗黙的にタイプ文字列をバイト[]に変換できません
しかし、私はクラスにヌルを渡したい場合は、私は次のエラーを取得する:ここでCannot implicitly convert type string to byte[]
は、クラスコードは次のとおりです。
public class MyHash
{
public static string ComputeHash(string plainText,
string hashAlgorithm, byte[] saltBytes)
{
Hash Code
}
}
私はクラスを使用すると、私はエラーを取得します: "暗黙のうちにあなたの 『ComputeHash』メソッドは文字列を返し、あなたはバイトaに、この戻り値を代入しようとしているので、これは[]」
//Encrypt Password
byte[] NoHash = null;
byte[] encds = MyHash.ComputeHash(Password, "SHA256", NoHash);
'string'は' byte [] 'に変換可能ですか? –