| 22 | |
| 23 | namespace util { |
| 24 | bool compare(const std::string &file1, const std::string &file2) { |
| 25 | std::stringstream ss1, ss2; |
| 26 | std::ifstream if1(file1.c_str(), std::ios::binary), if2(file2.c_str(), std::ios::binary); |
| 27 | ss1 << if1.rdbuf(); |
| 28 | ss2 << if2.rdbuf(); |
| 29 | return ss1.str() == ss2.str(); |
| 30 | } |
| 31 | |
| 32 | int write_rand(const char *path) { |
| 33 | int value = rand(); |