With custom data you can't create a serial number with fixed length. But you can associate a serial number with information e.g. in database. Simple serial number generator:
String serial = UUID.randomUUID().toString().toUpperCase();
System.out.println(serial);
PS: It's very unsafe to use mac address in serial number. It's very easy to change.