aboutsummaryrefslogtreecommitdiffstats
path: root/src/slskd/Common/Extensions.cs
diff options
context:
space:
mode:
authorJP Dillingham <jpdillingham@gmail.com>2021-06-14 20:03:36 -0500
committerJP Dillingham <jpdillingham@gmail.com>2021-06-14 20:03:36 -0500
commit050be311e68bb316cfc40fbd23bfd5a812e1a060 (patch)
tree1476cba9e90845f224bbc0a380e4633697e1306e /src/slskd/Common/Extensions.cs
parent4cf8f8fa862b08131e9cc51c4bad3d6c9838342b (diff)
downloadslskd-050be311e68bb316cfc40fbd23bfd5a812e1a060.tar.gz
move stuff around
Diffstat (limited to 'src/slskd/Common/Extensions.cs')
-rw-r--r--src/slskd/Common/Extensions.cs31
1 files changed, 0 insertions, 31 deletions
diff --git a/src/slskd/Common/Extensions.cs b/src/slskd/Common/Extensions.cs
index 32cbf443..a7a89a71 100644
--- a/src/slskd/Common/Extensions.cs
+++ b/src/slskd/Common/Extensions.cs
@@ -55,17 +55,6 @@ namespace slskd
}
/// <summary>
- /// Returns the SHA1 hash of the given string.
- /// </summary>
- /// <param name="str">The string to hash.</param>
- /// <returns>The hash.</returns>
- public static string Sha1(this string str)
- {
- using var sha1 = new SHA1Managed();
- return BitConverter.ToString(sha1.ComputeHash(Encoding.UTF8.GetBytes(str))).Replace("-", string.Empty);
- }
-
- /// <summary>
/// Formats byte to nearest size (KB, MB, etc.)
/// </summary>
/// <param name="value">The value to format.</param>
@@ -148,25 +137,5 @@ namespace slskd
{
return path.Replace('\\', Path.DirectorySeparatorChar).Replace('/', Path.DirectorySeparatorChar);
}
-
- /// <summary>
- /// Validates options.
- /// </summary>
- /// <param name="options">The options instance to validate.</param>
- /// <param name="result">The result of the validation, if invalid.</param>
- /// <returns>A value indicating whether the instance is valid.</returns>
- public static bool TryValidate(this Options options, out CompositeValidationResult result)
- {
- result = null;
- var results = new List<ValidationResult>();
-
- if (!Validator.TryValidateObject(options, new ValidationContext(options), results, true))
- {
- result = new CompositeValidationResult("Invalid configuration", results);
- return false;
- }
-
- return true;
- }
}
} \ No newline at end of file