Simulator.SimulatedLoginAttemptGenerator.AddTypoToPassword C# (CSharp) Méthode

AddTypoToPassword() public static méthode

Add a typo to a password for simulating user typo errors
public static AddTypoToPassword ( string originalPassword ) : string
originalPassword string The original password to add a typo to
Résultat string
        public static string AddTypoToPassword(string originalPassword)
        {
            // Adding a character will meet the edit distance def. of typo, though if simulating systems that weigh
            // different typos differently one might want to create a variety of typos here
            const string typoAlphabet = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ./";
            return originalPassword + typoAlphabet[(int) StrongRandomNumberGenerator.Get32Bits(typoAlphabet.Length)];
        }