public override int GetDigestSize()
{
return DigestLength;
}
private void HashPassword() { if (string.IsNullOrEmpty(Password)) Password = NoPassword; var pswBytes = Encoding.UTF8.GetBytes(Password); var sha512 = new Sha512Digest(); var hashedPassword = new byte[sha512.GetDigestSize()]; sha512.BlockUpdate(pswBytes, 0, pswBytes.Length); sha512.DoFinal(hashedPassword, 0); Hash = BitConverter.ToString(hashedPassword).Replace("-", "").ToLower(); Password = string.Empty; }