question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Device ID is not unique and changing over time

See original GitHub issue

Hi, thank you for the package. I am facing an issue, I am generating the IDs in a “service worker” in Windows Service mode using the below command. I am using the base package DeviceId without any other extension packages.

 new DeviceIdBuilder()
        .AddUserName()
        .AddMachineName()
        .AddMacAddress(excludeWireless: true)
        .ToString();

It works great but in a span of few hours (on the same network & machine) the generated ID gets changed.

Isn’t “Mac Address” is used as a seed to generate random string? Shouldn’t that be unique always?

Issue Analytics

  • State:closed
  • Created 4 months ago
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
hey24sheepcommented, May 12, 2023

I think this should fix my issue. I will update later on.

NetworkInterface
                .GetAllNetworkInterfaces()
                .Where(nic => nic.OperationalStatus == OperationalStatus.Up 
                        && nic.NetworkInterfaceType != NetworkInterfaceType.Loopback
                        && nic.NetworkInterfaceType == NetworkInterfaceType.Ethernet)
                .Select(nic => nic.GetPhysicalAddress().ToString())
                .ToList()
1reaction
hey24sheepcommented, May 10, 2023

Thank you, I will try it for a day or two and report back. Really appreciate your quick response.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Getting Device ID is not unique
I really have problem with getting unique deviceID. The code I am using now it this : UIDevice.currentDevice().identifierForVendor!
Read more >
If "DEVICE ID" for my laptop has been changed, can I tell ...
Each device in Windows has it's own unique identifier known as the Hardware ID. The Device ID is the identifier of the PC...
Read more >
Unique Device ID
The uuid on iOS is not unique to a device, but varies for each application, for each installation. It changes if you delete...
Read more >
I need to get user device unique id that doesn't change ...
I need to get user device unique id that doesn't change even if app un install and re-install again or after factory reset...
Read more >
Is it possible for two different users to have the same device ...
Device IDs are unique to individual devices which in turn are assigned to a unique user profile. They do not change on a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found