Domanda

I'm trying to find a way to generate a unique system ID (HWID) without having to add any other gems first.

In other words, I want someone who's running a brand new version of Mac/Linux to be able to generate an ID, without having to install anything else.

The only ID methods I've found require additional gems to be installed, so that wont work.

È stato utile?

Soluzione

To follow Catnapper's comment, uuidgen is available on Linux systems, including Darwin.

Just make a call to it in your Ruby script:

irb(main):001:0> `uuidgen`
=> "613C66FE-F609-4389-8A70-A59D245070AE\n"
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top