static*/
| 131 | |
| 132 | /*static*/ |
| 133 | QByteArray FileVersionDatabase::hashForFile(const QString & path) |
| 134 | { |
| 135 | QByteArray retVal = QByteArray::fromHex("d41d8cd98f00b204e9800998ecf8427e"); // hash for the zero-length string; |
| 136 | QFile fin(path); |
| 137 | |
| 138 | if (!fin.open(QIODevice::ReadOnly)) |
| 139 | return retVal; |
| 140 | |
| 141 | retVal = QCryptographicHash::hash(fin.readAll(), QCryptographicHash::Md5); |
| 142 | fin.close(); |
| 143 | return retVal; |
| 144 | } |
| 145 | |
| 146 | |
| 147 | } // namespace Utils |