using DomainObjects.Abstractions; using CryptoProvider; namespace DomainObjects; public class Password : DomainObjectBase { public string Hash { get; } public string Salt { get; } public DateTime Created { get; } public Password(string password) { var (salt, hash) = HashService.CreateSaltedHash(password); Hash = hash; Salt = salt; Created = DateTime.UtcNow; } private Password(string salt, string hash, DateTime created) { Hash = hash; Salt = salt; Created = created; } public Password Prototype() => new (Hash, Salt, Created); public override int GetHashCode() { throw new NotImplementedException(); } }