/// <summary> /// Creaetes a new passhash from the password string value /// </summary> public static Passhash PasswordToPasshash(string password, int iterationCount = ushort.MaxValue) { if (!IsPasswordValidLength(password.Length)) { throw new ArgumentException("Invalid password length"); } var hash = Cryptographer.ToSHA512(password, Encoding.UTF8, iterationCount); return(new Passhash(hash)); }
/// <summary> /// Creates a new cryptographically secure token instance /// </summary> public static Token Create() { return(new Token(Cryptographer.GetSecureRandom(ByteSize))); }