Created
October 19, 2023 09:42
-
-
Save namikiri/389061cfa2829946c64917232ef0a582 to your computer and use it in GitHub Desktop.
Galaxy hash generator for Qt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "galaxyhash.h" | |
GalaxyHash::GalaxyHash() | |
{ | |
} | |
QString GalaxyHash::getHash(const QString &salt) | |
{ | |
QString md5 = QString(QCryptographicHash::hash(salt.toUtf8(), QCryptographicHash::Md5).toHex()); | |
QString md5rev; | |
for (int i = md5.length() - 1; i >= 0; i--) | |
md5rev.append(QString(md5.at(i))+"0"); | |
return md5rev.mid(5, 10); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef GALAXYHASH_H | |
#define GALAXYHASH_H | |
#include <QString> | |
#include <QCryptographicHash> | |
#include <QByteArray> | |
#define GALAXY_HASH_VERSION 195 | |
class GalaxyHash | |
{ | |
public: | |
GalaxyHash(); | |
static QString getHash(const QString &salt); | |
}; | |
#endif // GALAXYHASH_H |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment