欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

C# get md5 from bytes

程序员文章站 2022-08-28 13:34:56
static byte[] GetBytesFromDic(Dictionary dic) { if(dic==null || !dic.Any()) { return null; } using (MemoryStream ms = new MemoryStream(... ......
 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;
            }
        }