示例#1
0
        public virtual string GetOrAddZnodeName(string configName)
        {
            //这里忽略SHA1理论上也存在重复的可能性
            string znodeName = HashAlgorithmHelper <SHA1CryptoServiceProvider> .ComputeHash(configName);

            this._dic[znodeName] = configName;
            return(znodeName);
        }
示例#2
0
        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));
        }
示例#3
0
 public virtual string GetZkRootPath()
 {
     return(Path.Combine("\\", AppName, HashAlgorithmHelper <MD5CryptoServiceProvider> .ComputeHash(Version), Environment));
 }