public final class MachineId extends Object
It works in three steps:
| 限定符和类型 | 方法和说明 |
|---|---|
static byte[] |
getMachineHash()
Returns the machine hash in a byte array.
|
static String |
getMachineHexa()
Returns the machine hash in hexadecimal format.
|
static long |
getMachineId()
Returns a number generated from the machine hash.
|
static String |
getMachineString()
Returns a string containing host name, MAC and IP.
|
static UUID |
getMachineUuid()
Returns a UUID generated from the machine hash.
|
public static long getMachineId()
It uses the first 8 bytes of the machine hash.
public static UUID getMachineUuid()
It uses the first 16 bytes of the machine hash.
The UUID version is 4.
public static String getMachineHexa()
The returning string has 64 chars.
public static byte[] getMachineHash()
The returning array has 32 bytes (256 bits).
public static String getMachineString()
Output format: "hostname 11-11-11-11-11-11 222.222.222.222"
Copyright © 2024. All rights reserved.