Skip to content

Commit

Permalink
Merge pull request #12 from vanillajonathan/patch-1
Browse files Browse the repository at this point in the history
Documentation fixes
  • Loading branch information
Bolorunduro Winner-Timothy B authored Jun 29, 2020
2 parents 3fe3fa2 + 0c37e5d commit f846552
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 f846552

Please sign in to comment.