QString OOFormat::hashGenerator( const QString name ) const { QCryptographicHash enmd5( QCryptographicHash::Sha1 ); enmd5.addData ( name.toUtf8() ); enmd5.addData ( "odt_name" ); const QByteArray chunkha = enmd5.result(); return QString(chunkha.toHex()); }
QString FoRegion::hash() const { QByteArray unique("Hash-Forerin:"); const QString header = QString("%1|%2|%3|%4|").arg(margin_top).arg(margin_bottom) .arg(margin_right).arg(margin_left); const QString margin = QString("%1|%2|%3").arg(bg.name()).arg(bog.name()) .arg(border); QString position = "Disable"; if (enable) { position = "Enable"; } unique.append(position); unique.append(header); unique.append(margin); QCryptographicHash enmd5( QCryptographicHash::Sha1 ); enmd5.addData ( unique ); const QByteArray chunkha = enmd5.result(); return QString(chunkha.toHex()); }
QByteArray M_PageSize::hashmodel() const { QByteArray unique("Hash-PageFormat:"); const QString header = QString("%1|%2|%3|%4|").arg(name).arg(G_regt.width()) .arg(G_regt.height()).arg(modus); const QString margin = QString("%1|%2|%3|%4").arg(body.margin_top).arg(body.margin_bottom) .arg(body.margin_right).arg(body.margin_left); QString position = "Portrait"; if (landscape) { position = "Landscape"; } unique.append(position); unique.append(header); unique.append(margin); const int totr = (int)region; for (int i = 0; i < totr; ++i) { unique.append(area[i].hash()); } QCryptographicHash enmd5( QCryptographicHash::Sha1 ); enmd5.addData ( unique ); const QByteArray chunkha = enmd5.result(); return chunkha.toHex(); }