Skip to content

Commit

Permalink
Documentation fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
vanillajonathan authored Jun 1, 2020
1 parent 3fe3fa2 commit 0c37e5d
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions shortid/ShortId.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,24 @@ public static class ShortId
private static readonly object ThreadLock = new object();

/// <summary>
/// Generates a random string of varying length with special characters and without numbers
/// Generates a random string of varying length with special characters and without numbers.
/// </summary>
/// <param name="useNumbers">Whether or not to include numbers</param>
/// <param name="useSpecial">Whether or not special characters are included</param>
/// <returns>A random string</returns>
/// <param name="useNumbers">Whether or not to include numbers.</param>
/// <param name="useSpecial">Whether or not special characters are included.</param>
/// <returns>A random string.</returns>
public static string Generate(bool useNumbers = false, bool useSpecial = true)
{
var length = _random.Next(7, 15);
return Generate(useNumbers, useSpecial, length);
}

/// <summary>
/// Generates a random string of a specified length with the option to add numbers and special characters
/// Generates a random string of a specified length with the option to add numbers and special characters.
/// </summary>
/// <param name="useNumbers">Whether or not numbers are included in the string</param>
/// <param name="useSpecial">Whether or not special characters are included</param>
/// <param name="length">The length of the generated string</param>
/// <returns>A random string</returns>
/// <param name="useNumbers">Whether or not numbers are included in the string.</param>
/// <param name="useSpecial">Whether or not special characters are included.</param>
/// <param name="length">The length of the generated string.</param>
/// <returns>A random string.</returns>
public static string Generate(bool useNumbers, bool useSpecial, int length)
{
if (length < 7)
Expand Down Expand Up @@ -75,20 +75,20 @@ public static string Generate(bool useNumbers, bool useSpecial, int length)
}

/// <summary>
/// Generates a random string of a specified length with special characetrs and without numbers
/// Generates a random string of a specified length with special characetrs and without numbers.
/// </summary>
/// <param name="length">The length of the generated string</param>
/// <returns>A random string</returns>
/// <param name="length">The length of the generated string.</param>
/// <returns>A random string.</returns>
public static string Generate(int length)
{
return Generate(false, true, length);
}

/// <summary>
/// Changes the character set that id's are generated from
/// Changes the character set that id's are generated from.
/// </summary>
/// <param name="characters">The new character set</param>
/// <exception cref="InvalidOperationException">Thrown when the new character set is less than 20 characters</exception>
/// <param name="characters">The new character set.</param>
/// <exception cref="InvalidOperationException">Thrown when the new character set is less than 20 characters.</exception>
public static void SetCharacters(string characters)
{
if (string.IsNullOrWhiteSpace(characters))
Expand Down Expand Up @@ -117,7 +117,7 @@ public static void SetCharacters(string characters)
/// <summary>
/// Sets the seed that the random generator works with.
/// </summary>
/// <param name="seed">The seed for the random number generator</param>
/// <param name="seed">The seed for the random number generator.</param>
public static void SetSeed(int seed)
{
lock (ThreadLock)
Expand All @@ -127,7 +127,7 @@ public static void SetSeed(int seed)
}

/// <summary>
/// Resets the random number generator and character set
/// Resets the random number generator and character set.
/// </summary>
public static void Reset()
{
Expand All @@ -138,4 +138,4 @@ public static void Reset()
}
}
}
}
}

0 comments on commit 0c37e5d

Please sign in to comment.