public virtual string GetOrAddZnodeName(string configName) { //这里忽略SHA1理论上也存在重复的可能性 string znodeName = HashAlgorithmHelper <SHA1CryptoServiceProvider> .ComputeHash(configName); this._dic[znodeName] = configName; return(znodeName); }
public static string GenerateMd5(IFormFile file) { using var fileStream = file.OpenReadStream(); var bt = new byte[fileStream.Length]; fileStream.Read(bt, 0, bt.Length); var fileString = Convert.ToBase64String(bt); return(HashAlgorithmHelper.ComputeHash <MD5>(fileString)); }
public virtual string GetZkRootPath() { return(Path.Combine("\\", AppName, HashAlgorithmHelper <MD5CryptoServiceProvider> .ComputeHash(Version), Environment)); }