

If ('openbsd') or sys.platform.1: public static Func Fix(Func, Func> F) 2: " which is a cleaner way if you don't want to write your own extension method (which you could too). Return run('cat /var/lib/dbus/machine-id') or \ Return run('wmic csproduct get uuid').split('\n') \ If sys.platform = 'win32' or sys.platform = 'cygwin' or sys.platform = 'msys': "ioreg -d2 -c IOPlatformExpertDevice | awk -F\\\" '/IOPlatformUUID/'", Return n(cmd, shell=True, capture_output=True, check=True, encoding="utf-8") \ The package also has support for hashing the ID, to anonymize it.

all of my attempts to find something have failed.Īfter seeing this question asked quite a few times both here on SO as well as in support requests for my software licensing business (called Keygen), I wrote a small, cross-platform PyPI package that queries a machine's native GUID called machineid.Įssentially, it looks like this, but with some Windows-specific WMI registry queries for more a accurate ID. If you have a better way of obtaining a unique ID for a machine, that I can generate each time and won't have to worry about deletion of it or something - I'd be glad to hear it. One part says "If all attempts to obtain the hardware address fail, we choose a random 48-bit number with its eighth bit set to 1 as recommended in RFC 4122", which means that I may get a different unique on some systems for some reason - is there a way to identify which time it failed and generate something else?Īnother part says: " “Hardware address” means the MAC address of a network interface, and on a machine with multiple network interfaces the MAC address of any one of them may be returned.", which means if i have 2 different network adapters, each call I may get any one of them? that's not good for me. I've taken a look at uuid.getNode(), but I have 2 problems with it:

I've checked UUID, and it seems ok but I'm not sure. I do not want to save that ID on a text file or something, but I want to generate it from hardware every time I need it (in case the text with the ID gets deleted or something) I have a process that requires me to identify different machines, and I'm not sure what's the best way to do it.
