How to compare binary files to check if they are the same?

前端 未结 14 680
傲寒
傲寒 2020-12-07 09:25

What is the easiest way (using a graphical tool or command line on Ubuntu Linux) to know if two binary files are the same or not (except for the time stamps)? I do not need

14条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-07 09:52

    There is a relatively simple way to check if two binary files are the same.

    If you use file input/output in a programming language; you can store each bit of both the binary files into their own arrays.

    At this point the check is as simple as :

    if(file1 != file2){
        //do this
    }else{
        /do that
    }
    

提交回复
热议问题