public class LightId extends Object
64 bit = 1bit(0 fixed) + 8bit (CRC8) + 1bit(Layout) + 54bit(block+sequence) 8bit reserved for Crc8Long encode, default 0 1bit whole-seq(0); block-seq(1) whole-seq(0) = sequence(54bit=18014398509481983) block-seq(1) = block(9bit=512) + sequence((54-9=45)bit=35184372088831) for 512 block unstopped 50000 id/second, running (2^45 -1)/(365*24*3600*50000) = 22.3 years
Crc8Long| Modifier and Type | Field and Description |
|---|---|
static int |
BIT_BLOCK |
static int |
BIT_LIGHT |
static int |
BIT_SEQ_BLOCK |
static int |
BIT_SEQ_WHOLE |
static int |
MAX_BLOCK |
static long |
MAX_SEQ_BLOCK |
static long |
MAX_SEQ_WHOLE |
static int |
MIN_BLOCK |
static long |
MIN_SEQ |
static LightId |
NONE |
static long |
TKN_LAYOUT |
static LightId |
ZERO |
| Constructor and Description |
|---|
LightId(int block,
long sequence)
Constructed by block and sequence.
|
| Modifier and Type | Method and Description |
|---|---|
int |
component1() |
long |
component2() |
boolean |
equals(Object o) |
int |
getBlock()
Get block, 0 means whole-seq layout, above 1 is block-seq layout
|
long |
getSequence() |
int |
hashCode() |
long |
toLong() |
@NotNull String |
toString() |
public static final LightId NONE
public static final LightId ZERO
public static final int BIT_LIGHT
public static final int BIT_BLOCK
public static final int MIN_BLOCK
public static final int MAX_BLOCK
public static final int BIT_SEQ_WHOLE
public static final int BIT_SEQ_BLOCK
public static final long MIN_SEQ
public static final long MAX_SEQ_WHOLE
public static final long MAX_SEQ_BLOCK
public static final long TKN_LAYOUT
public LightId(int block,
long sequence)
Copyright © 2023. All rights reserved.