C# get md5 from bytes

 static byte[] GetBytesFromDic(Dictionary<string,string> dic)
        {
            if(dic==null || !dic.Any())
            {
                return null;
            }
            using (MemoryStream ms = new MemoryStream())
            {
                BinaryFormatter binFormatter = new BinaryFormatter();
                binFormatter.Serialize(ms, dic);
                byte[] dicBytes = ms.ToArray();           
                return dicBytes;
            }
        }

 

posted @ 2019-12-17 11:30  FredGrit  阅读(296)  评论(0编辑  收藏  举报