What is the fastest way to compare two byte arrays?

后端 未结 6 1585
你的背包
你的背包 2021-01-18 07:59

I am trying to compare two long bytearrays in VB.NET and have run into a snag. Comparing two 50 megabyte files takes almost two minutes, so I\'m clearly doing something wron

6条回答
  •  独厮守ぢ
    2021-01-18 08:22

    Better approach... If you are just trying to see if the two are different then save some time by not having to go through the entire byte array and generate a hash of each byte array as strings and compare the strings. MD5 should work fine and is pretty efficient.

提交回复
热议问题