如何将密码哈希转换为字符串?
public void AddStudent(Student student)
{
student.StudentID = (++eCount).ToString();
byte[] passwordHash = Hash(student.Password, GenerateSalt());
student.Password = passwordHash; //this line?
student.TimeAdded = DateTime.Now;
students.Add(student);
}
如果我尝试:
public void AddStudent(Student student)
{
student.StudentID = (++eCount).ToString();
byte[] passwordHash = Hash(student.Password, GenerateSalt());
student.Password = Convert.ToString(passwordHash); //this line?
student.TimeAdded = DateTime.Now;
students.Add(student);
}
当我获取我的学生集合时,密码字段会显示 System.Byte[] 我想在哪里取回散列/加盐密码?