Reduce more complexity

This commit is contained in:
Matt Nadareski
2024-10-24 04:21:13 -04:00
parent 759a771f4b
commit 292b54b209
4 changed files with 33 additions and 14 deletions

View File

@@ -2,6 +2,7 @@
using System.IO;
using System.Linq;
using SabreTools.Hashing;
using SabreTools.IO.Extensions;
using SabreTools.Matching;
namespace SabreTools.Core.Tools
@@ -45,6 +46,18 @@ namespace SabreTools.Core.Tools
return string.Equals(firstHash, secondHash, StringComparison.OrdinalIgnoreCase);
}
/// <summary>
/// Get a proper romba sub path
/// </summary>
/// <param name="hash">SHA-1 hash to get the path for</param>
/// <param name="depth">Positive value representing the depth of the depot</param>
/// <returns>Subfolder path for the given hash</returns>
public static string? GetDepotPath(byte[]? hash, int depth)
{
string? sha1 = ByteArrayExtensions.ByteArrayToString(hash);
return GetDepotPath(sha1, depth);
}
/// <summary>
/// Get a proper romba sub path
/// </summary>