mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2026-01-16 08:25:28 +00:00
@@ -25,6 +25,7 @@ using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Humanizer;
|
||||
@@ -105,6 +106,15 @@ namespace ArchiSteamFarm {
|
||||
Task.Factory.StartNew(function, CancellationToken.None, options, TaskScheduler.Default);
|
||||
}
|
||||
|
||||
internal static bool IsValidCdKey(string key) {
|
||||
if (string.IsNullOrEmpty(key)) {
|
||||
ASF.ArchiLogger.LogNullError(nameof(key));
|
||||
return false;
|
||||
}
|
||||
|
||||
return Regex.IsMatch(key, @"^[0-9A-Z]{4,7}-[0-9A-Z]{4,7}-[0-9A-Z]{4,7}(?:(?:-[0-9A-Z]{4,7})?(?:-[0-9A-Z]{4,7}))?$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
||||
}
|
||||
|
||||
internal static bool IsValidHexadecimalString(string text) {
|
||||
if (string.IsNullOrEmpty(text)) {
|
||||
ASF.ArchiLogger.LogNullError(nameof(text));
|
||||
|
||||
Reference in New Issue
Block a user