1 package org
.argeo
.api
.uuid
;
3 import java
.util
.function
.Supplier
;
5 /** A factory for node id base */
6 public interface NodeIdSupplier
extends Supplier
<Long
> {
7 long LEAST_SIG_RFC4122_VARIANT
= (1l << 63);
9 static long toNodeIdBase(byte[] node
) {
10 assert node
.length
== 6;
11 return LEAST_SIG_RFC4122_VARIANT
// base for Leach–Salz UUID
12 | (node
[0] & 0xFFL
) //
13 | ((node
[1] & 0xFFL
) << 8) //
14 | ((node
[2] & 0xFFL
) << 16) //
15 | ((node
[3] & 0xFFL
) << 24) //
16 | ((node
[4] & 0xFFL
) << 32) //
17 | ((node
[5] & 0xFFL
) << 40); //