Package oshi.demo
Class ComputerID
java.lang.Object
oshi.demo.ComputerID
Attempts to create a unique computer identifier. Note that serial numbers won't work on Linux without user
cooperation.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
Generates a Computer Identifier, which may be part of a strategy to construct a licence key.static void
main.
-
Field Details
-
NON_UNIQUE_UUIDS
-
-
Constructor Details
-
ComputerID
public ComputerID()
-
-
Method Details
-
main
main.
- Parameters:
args
- an array ofString
objects.
-
getComputerIdentifier
Generates a Computer Identifier, which may be part of a strategy to construct a licence key. (The identifier may not be unique as in one case hashcode could be same for multiple values, and the result may differ based on whether the program is running with sudo/root permission.) The identifier string is based upon the processor serial number, vendor, system UUID, processor identifier, and total processor count.- Returns:
- A string containing four hyphen-delimited fields representing the processor; the first 3 are 32-bit hexadecimal values and the last one is an integer value.
-