Page 1 of 1

getDeviceID returns different values on the same device

Posted: September 26th, 2022, 4:29 am
by becklesd
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

Re: getDeviceID returns different values on the same device

Posted: September 26th, 2022, 8:06 am
by Gregory Martin
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.

Re: getDeviceID returns different values on the same device

Posted: September 27th, 2022, 2:41 am
by becklesd
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

Re: getDeviceID returns different values on the same device

Posted: September 27th, 2022, 6:02 pm
by aaronw
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

Posted: October 7th, 2022, 6:48 am
by becklesd
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.