Could look into using Lexicoders. The following program prints out 19.
However this will vary depending on how many leading 0 bytes the longs
have, because those are dropped.
long time = System.currentTimeMillis();
ListLexicoder<Long> ll = new ListLexicoder<Long>(new ULongLexicoder());
List<Long> list = Arrays.asList(new Long[3]);
list.set(0, time);
list.set(1, 123456l);
list.set(2, 987654l);
byte[] b = ll.encode(list);
System.out.println(b.length);
On Wed, Jun 24, 2015 at 2:32 AM, mohit.kaushik <[email protected]>
wrote:
> On 06/23/2015 06:44 PM, Keith Turner wrote:
>
>> row=<time>_<client id>_<client counter>
>>
> this will definitely generate a UUID but if I use "14 digits for <time> +
> 12 digits for <client_id> + say 6 digits for <client_counter>" which makes
> the UUID 32 bit long. I want UUID to be 16 digits long.
>
> Can you suggest some encoding technique which can encode it to 16 digits
> and also maintains the time order?
>
> -Mohit kaushik
>
>