If you want an 80-bit counter then you can create a structure to store 80 bits then add from the low part to the high part (with carry)
class Counter {
private long low; // 64 low bits of the counter
private short high; // 16 high bits
public void inc() {
low++;
if (low == 0) // wrapped around, which means there's a carry
high++; // add the carry to the high part
}
public String toHex() {
return String.format("%04X%016X", high & 0xffff, low);
}
}
If you don't want leading 0's then change the toHex
function like this
if (low == 0)
return Long.toHexString(low);
else
return Integer.toHexString(high & 0xffff) + String.format("%016X", low);
However, you can't count up to that maximum value in your whole life, because to count only 64-bit values you have to spend ~9223372036 seconds or 292 years, assuming your CPU can count 2 billion values in a second while ignore the loop and all other things needed to be done by the OS. Adding 16 more bits and you'll need more than 19 million years to count up all.