Skip to content

Instantly share code, notes, and snippets.

@namikiri
Created October 19, 2023 09:42
Show Gist options
  • Save namikiri/389061cfa2829946c64917232ef0a582 to your computer and use it in GitHub Desktop.
Save namikiri/389061cfa2829946c64917232ef0a582 to your computer and use it in GitHub Desktop.
Galaxy hash generator for Qt
#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);
}
#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