1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#include <QtCore/QCoreApplication>
#include <QString>
#include <QByteArray>
#include <QCryptographicHash>
#include <QDebug>
#include <QStringList>
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
QStringList args = a.arguments();
if (args.length() != 3) {
qDebug() << QString("AppID and UDID is required");
return 1;
}
QString secret("crizzin");
QString app_id(argv[1]), device_id(argv[2]);
QString message = secret + device_id + app_id;
QByteArray hashData = QCryptographicHash::hash(QByteArray(message.toAscii()),
QCryptographicHash::Md5); // or QCryptographicHash::Sha1
qDebug() << hashData.toHex();
return 0;
}