MCPcopy Create free account
hub / github.com/TeXworks/texworks / hashForFile

Method hashForFile

src/utils/FileVersionDatabase.cpp:133–144  ·  view source on GitHub ↗

static*/

Source from the content-addressed store, hash-verified

131
132/*static*/
133QByteArray 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

Callers

nothing calls this directly

Calls 2

hashFunction · 0.85
openMethod · 0.45

Tested by

no test coverage detected