Question

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.

Was it helpful?

Solution

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"
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top