[ArchiveTools] Make it easier to rebuild to TGZ

This commit is contained in:
Matt Nadareski
2017-01-30 23:16:05 -08:00
parent 70393e4c15
commit 9b42dffba4
4 changed files with 29 additions and 46 deletions

View File

@@ -387,6 +387,22 @@ namespace SabreTools.Helper.Tools
.ToArray());
}
/// <summary>
/// Get a proper romba sub path
/// </summary>
/// <param name="hash">SHA-1 hash to get the path for</param>
/// <returns>Subfolder path for the given hash</returns>
public static string GetRombaPath(string hash)
{
// If the hash isn't the right size, then we return null
if (hash.Length != Constants.SHA1Length)
{
return null;
}
return Path.Combine(hash.Substring(0, 2), hash.Substring(2, 2), hash.Substring(4, 2), hash.Substring(6, 2), hash + ".gz");
}
/// <summary>
/// Get if a string contains Unicode characters
/// </summary>