ScrewTurn.Wiki.Tools.ComputeSecurityHash C# (CSharp) Method

ComputeSecurityHash() public static method

Computes the Hash of a Username, mixing it with other data, in order to avoid illegal Account activations.
public static ComputeSecurityHash ( string username, string email, System.DateTime dateTime ) : string
username string The Username.
email string The email.
dateTime System.DateTime The date/time.
return string
        public static string ComputeSecurityHash(string username, string email, DateTime dateTime)
        {
            return Hash.ComputeSecurityHash(username, email, dateTime, Settings.MasterPassword);
        }

Usage Example

示例#1
0
        /// <summary>
        /// Loads the user for the password reset procedure.
        /// </summary>
        /// <returns>The user, or <c>null</c>.</returns>
        private UserInfo LoadUserForPasswordReset()
        {
            UserInfo user = Users.FindUser(Request["Username"]);

            if (user != null && Request["ResetCode"] == Tools.ComputeSecurityHash(user.Username, user.Email, user.DateTime))
            {
                return(user);
            }
            return(null);
        }
All Usage Examples Of ScrewTurn.Wiki.Tools::ComputeSecurityHash