protected static string GetIdStr_FromConnStrAndSqlFile(string connectionString, string sqlFileName) { if (string.IsNullOrWhiteSpace(connectionString)) { throw new ArgumentException($"{nameof(connectionString)} cannot be null or whitespace", nameof(connectionString)); } if (string.IsNullOrWhiteSpace(sqlFileName)) { throw new ArgumentException($"{nameof(sqlFileName)} cannot be null or whitespace", nameof(sqlFileName)); } sqlFileName = Path.GetFileName(sqlFileName); var idStr = $"{connectionString.Trim().ToLower()} - {sqlFileName.Trim().ToLower()}"; var md5 = HelperFns.ComputeHash(idStr, MD5.Create()); var md5Guid = Guid.Parse(md5); return(md5Guid.ToString()); }
public static string GetPathMd5(string path) => HelperFns.ComputeHash(path?.Trim()?.ToLower(), MD5.Create());
protected string GetHash(string sqlUnit) => HelperFns.ComputeHash(sqlUnit?.Trim(), HashAlgorithm);