Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Generate unique hardware id - Cross platform
AliReza Beytari last edited by
Hi. Dose Qt have any reference to generate a unique hardware id?!
If not, please submit a code of pure C++!
No, since there is no generic way to do so.
But you should be able to get the MAC address (which can get easily spoofed by the user though) and/or CPU id (shouldn't be too hard to get on various systems.
beecksche last edited by
this generates a random unique ID. So creating such ID multiple times on the same machine creates different IDs, which is not desired.
What one usually does is to put a bunch of hardware ids (macs, cpu id, mb id) together, as @raven-worx suggested, and then to run a hash function over them (e.g. sha1). However, generating such identifiers is a pretty suspicious design in my opinion, as any change in the used (for ids) hardware will break the id matching.
However, generating such identifiers is a pretty suspicious design in my opinion, as any change in the used (for ids) hardware will break the id matching.
which may be the goal after all ;)
which may be the goal after all
Okay, I haven't thought about that ... it might be. :)
AshkanV last edited by
Hi to all
As of Qt 5.11 there is a static function in QSysInfo class: