There is a problem with getdeviceid() on my Windows 10 laptop in that it does not always return the same value. Over the last few days it has returned:
'00155d3c3d2e', '00155d6eb6da', '00155db5ac1b', '00155dd9c717'
The hardware has not changed over that time.
On Android the function behaves as expected.
Is there an alternative way of getting a unique identifier for a Windows machine?
Best regards
David Beckles
getDeviceID returns different values on the same device
-
- Posts: 1845
- Joined: December 5th, 2011, 11:27 pm
- Location: Washington, DC
Re: getDeviceID returns different values on the same device
If you only expect one person to log in on any given device, you could use the getusername function: https://www.csprousers.org/help/CSPro/g ... ction.html
However, that isn't purely unique because the person could be logged in on multiple machines.
The uuid function will return a unique value: https://www.csprousers.org/help/CSPro/u ... ction.html
Depending on your needs, you could generate a UUID, write it to a file on the Windows machine, and then read it back in to get the unique ID. This isn't perfect, as the ID would change it someone deletes the file, but if you trust your interviewers not to do this, this could be a decent workaround.
However, that isn't purely unique because the person could be logged in on multiple machines.
The uuid function will return a unique value: https://www.csprousers.org/help/CSPro/u ... ction.html
Depending on your needs, you could generate a UUID, write it to a file on the Windows machine, and then read it back in to get the unique ID. This isn't perfect, as the ID would change it someone deletes the file, but if you trust your interviewers not to do this, this could be a decent workaround.
Re: getDeviceID returns different values on the same device
Hi Gregory,
Thanks for your reply. It's a good workaround, but I'll use savesetting/loadsetting instead of a file.
Any chance of getting a version of getdeviceID that works on Windows 10?
Best regards
Becklesd
Thanks for your reply. It's a good workaround, but I'll use savesetting/loadsetting instead of a file.
Any chance of getting a version of getdeviceID that works on Windows 10?
Best regards
Becklesd
Re: getDeviceID returns different values on the same device
On Windows the function returns the MAC address and Windows has an option to randomize it. The option is called "random hardware address." Any chance it is on?
Re: getDeviceID returns different values on the same device
In my case, no randomizing is not on. But the result returned seems to depend on the network connection and whether a VPN is in use.