[guest@localhost ~]$ s="May 31 04:12:10 SSCK01 dhcpd[16691]: [ID 988538 local7.notice] [tid:30] NTCE DHCPOP(101) Protocol: DHCPDiscover from STRING-K01 PON 1/1/02/01:12.1.1 (chAddr=00:13:77:6d:44:6b) via 81.91.202.1."
[guest@localhost ~]$
[guest@localhost ~]$ echo "$s" | sed 's/.* from //; s/ (.*//'
STRING-K01 PON 1/1/02/01:12.1.1
[guest@localhost ~]$
public static BigInteger generateBigInteger(int length, Random random) {
StringBuilder builder = new StringBuilder(length);
builder.append(random.nextInt(9) + 1);
for (int i = 1; i < length; i++) {
builder.append(random.nextInt(10));
}
return new BigInteger(builder.toString());
}
BigInteger b;
do{
b = new BigInteger(48, new SecureRandom());
} while (b.toString().length()!=14);
System.out.println(b.toString());