Skip to content

Commit

Permalink
fix(gui): display crc32 in base-16
Browse files Browse the repository at this point in the history
  • Loading branch information
craftablescience committed Jun 6, 2024
1 parent eb6c30a commit d0dde9a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/gui/previews/DirPreview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -372,12 +372,13 @@ void DirPreview::addRowForFile(const PackFile& packFile, const QString& path) {
this->setItem(this->rowCount() - 1, Column::VPK_ARCHIVE_INDEX, archiveIndexItem);

// CRC32
auto* crc32Item = new QTableWidgetItem(QString::number(entry->crc32));
QByteArray crc32{reinterpret_cast<const char*>(&entry->crc32), sizeof(entry->crc32)};
auto* crc32Item = new QTableWidgetItem("0x" + crc32.toHex().toUpper());
this->setItem(this->rowCount() - 1, Column::CRC32, crc32Item);

// MD5
QByteArray md5{reinterpret_cast<const char*>(entry->pck_md5.data()), static_cast<qsizetype>(entry->pck_md5.size())};
auto* md5Item = new QTableWidgetItem(md5.toHex().toUpper());
auto* md5Item = new QTableWidgetItem("0x" + md5.toHex().toUpper());
this->setItem(this->rowCount() - 1, Column::PCK_MD5, md5Item);
}

Expand Down

0 comments on commit d0dde9a

Please sign in to comment.