Returns an IPv6 address in hh:hh:hh:hh:hh:hh:hh:hh format. @return a correctly formatted IPv6 address.
()
| 241 | * @return a correctly formatted IPv6 address. |
| 242 | */ |
| 243 | public String ipV6Address() { |
| 244 | final StringBuilder tmp = new StringBuilder(); |
| 245 | for (int i=0;i < 8;i++) { |
| 246 | if (i > 0) { |
| 247 | tmp.append(":"); |
| 248 | } |
| 249 | tmp.append(Integer.toHexString(faker.random().nextInt(16))); |
| 250 | tmp.append(Integer.toHexString(faker.random().nextInt(16))); |
| 251 | tmp.append(Integer.toHexString(faker.random().nextInt(16))); |
| 252 | tmp.append(Integer.toHexString(faker.random().nextInt(16))); |
| 253 | } |
| 254 | return tmp.toString(); |
| 255 | } |
| 256 | |
| 257 | /** |
| 258 | * @return a valid IPV6 CIDR |