| 25 | // create new uuidv5 based on net adapter MAC, save to db and return |
| 26 | QString hash; |
| 27 | foreach(QNetworkInterface interface, QNetworkInterface::allInterfaces()) |
| 28 | { |
| 29 | if (!(interface.flags() & QNetworkInterface::IsLoopBack)) |
| 30 | { |
| 31 | hash = QCryptographicHash::hash(interface.hardwareAddress().toLocal8Bit(), QCryptographicHash::Sha1).toHex(); |
| 32 | break; |
| 33 | } |
| 34 | } |
| 35 | const QString newUuid = QUuid::createUuidV5(QUuid(), hash).toString().mid(1, 36); |
| 36 | VectorPair cond; |
| 37 | cond.append(CPair("uuid", newUuid)); |