diff options
Diffstat (limited to 'src/Message.h')
-rw-r--r-- | src/Message.h | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/Message.h b/src/Message.h index 17c0a3baf..7980606ca 100644 --- a/src/Message.h +++ b/src/Message.h @@ -57,7 +57,8 @@ MUMBLE_MH_MSG(VoiceTarget) \ MUMBLE_MH_MSG(PermissionQuery) \ MUMBLE_MH_MSG(CodecVersion) \ - MUMBLE_MH_MSG(UserStats) + MUMBLE_MH_MSG(UserStats) \ + MUMBLE_MH_MSG(RequestBlob) class MessageHandler { public: @@ -83,6 +84,22 @@ inline ::std::string u8(const QString &str) { return ::std::string(qba.constData(), qba.length()); } +inline QByteArray blob(const ::std::string &str) { + return QByteArray(str.data(), static_cast<int>(str.length())); +} + +inline ::std::string blob(const QByteArray &str) { + return ::std::string(str.constData(), str.length()); +} + +inline QByteArray sha1(const QByteArray &blob) { + return QCryptographicHash::hash(blob, QCryptographicHash::Sha1); +} + +inline QByteArray sha1(const QString &str) { + return QCryptographicHash::hash(str.toUtf8(), QCryptographicHash::Sha1); +} + #else class Message; #endif |