BloggingSystem.Services.Validators.UserValidator.GenerateSessionKey C# (CSharp) Метод

GenerateSessionKey() публичный статический Метод

public static GenerateSessionKey ( int userID ) : string
userID int
Результат string
        public static string GenerateSessionKey(int userID)
        {
            StringBuilder sessionKey = new StringBuilder(SessionKeyLength);
            sessionKey.Append(userID);
            while (sessionKey.Length < SessionKeyLength)
            {
                var index = RandomGenerator.Next(ValidSessionKeyChars.Length);
                sessionKey.Append(ValidSessionKeyChars[index]);
            }

            return sessionKey.ToString();
        }
    }