mirror of
https://github.com/QuasarApp/Heart.git
synced 2025-04-27 10:14:36 +00:00
move auth to base64 from hex
This commit is contained in:
parent
2beefa22ca
commit
9ff5f6664b
@ -36,7 +36,8 @@ bool AsyncKeysAuth::auth(int allowedTimeRangeSec, QString* userId) const {
|
||||
|
||||
if (result && userId) {
|
||||
*userId = QCryptographicHash::hash(_publicKey,
|
||||
QCryptographicHash::Sha256).toHex();
|
||||
QCryptographicHash::Sha256).
|
||||
toBase64(QByteArray::Base64UrlEncoding);
|
||||
}
|
||||
|
||||
return result;
|
||||
|
@ -55,7 +55,7 @@ public:
|
||||
|
||||
/**
|
||||
* @brief auth This method make authentication and return true if the authentication finished successful else false.
|
||||
* @brief retLoginedUserId This is logined user id in hex
|
||||
* @brief retLoginedUserId This is logined user id in Base64UrlEncoding
|
||||
* @return true if the authentication finished successful else false.
|
||||
*/
|
||||
bool auth(int allowedTimeRangeSec, QString* retLoginedUserId) const;
|
||||
|
@ -50,7 +50,7 @@ void ECDSAAuthTest::test() {
|
||||
// make user id
|
||||
QString userIDOfPubKey = QCryptographicHash::hash(pub,
|
||||
QCryptographicHash::Sha256).
|
||||
toHex();
|
||||
toBase64(QByteArray::Base64UrlEncoding);
|
||||
|
||||
// check createed keys. should be larget then 0.
|
||||
QVERIFY(pub.length() && priv.length());
|
||||
|
Loading…
x
Reference in New Issue
Block a user