1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
/// <summary>
/// Determines whether [is valid M d5] [the specified candidate].
/// </summary>
/// <param name="candidate">The candidate.</param>
/// <returns>
/// <c>true</c> if [is valid M d5] [the specified candidate]; otherwise, <c>false</c>.
/// </returns>
public static bool IsValidMD5(string candidate)
{
if (string.IsNullOrEmpty(candidate))
return false;
Regex isMD5 = new Regex(@"^([a-fA-F0-9]){32}$");
return isMD5.IsMatch(candidate);
}
|