MCPcopy Create free account
hub / github.com/awawa-dev/HyperHDR / createUser

Method createUser

sources/db/AuthTable.cpp:16–29  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14};
15
16bool AuthTable::createUser(const QString& user, const QString& pw)
17{
18 // new salt
19 QByteArray salt = QCryptographicHash::hash(QUuid::createUuid().toByteArray(), QCryptographicHash::Sha512).toHex();
20 QVariantMap map;
21 map["user"] = user;
22 map["salt"] = salt;
23 map["password"] = hashPasswordWithSalt(pw, salt);
24 map["created_at"] = QDateTime::currentDateTimeUtc().toString(Qt::ISODate);
25
26 VectorPair cond;
27 cond.append(CPair("user", user));
28 return createRecord(cond, map);
29}
30
31void AuthTable::savePipewire(const QString& wToken)
32{

Callers 1

AccessManagerMethod · 0.80

Calls 2

toHexMethod · 0.80
toStringMethod · 0.45

Tested by

no test coverage detected