private static string _GetMD5Value(MD5Kind kind, ILogging logger, string[] lines) { string key = lines.FirstOrDefault(l => l.StartsWith(kind.ToString())); if (key == null) { logger.WriteLog(ErrorCodes.LocalDirectorySource_InvalidMD5File, ErrorResources.LocalDirectorySource_InvalidMD5File, Severity.Error, VerboseLevel.User); return(null); } return(key.Replace(kind.ToString() + ":", "")); }
public static string GetMD5FromFile(string md5File, MD5Kind kind, ILogging logger) { string[] lines = File.ReadAllLines(md5File); return(_GetMD5Value(kind, logger, lines)); }
public static string GetMD5FromString(string data, MD5Kind kind, ILogging logger) { string[] lines = data.Split(Environment.NewLine); return(_GetMD5Value(kind, logger, lines)); }