@ThreadSafe public class Crc8Long extends Object
| Modifier and Type | Field and Description |
|---|---|
static long |
MAX_NUMBER |
static long |
MIN_NUMBER |
| Constructor and Description |
|---|
Crc8Long()
Use the default pseudo-random seed
|
Crc8Long(int[] seed)
Specifies pseudo-random seed to generate insert positions of obfuscated values (crc8).
|
| Modifier and Type | Method and Description |
|---|---|
long |
decode(long value)
decode a pseudo-random to the number
fail if return
Long.MIN_VALUE |
long |
encode(long number)
encode a number to the pseudo-random
fail if return
Long.MIN_VALUE |
public static final long MAX_NUMBER
public static final long MIN_NUMBER
public Crc8Long()
public Crc8Long(int[] seed)
Specifies pseudo-random seed to generate insert positions of obfuscated values (crc8). It is equivalent to dividing the 55bit number into 9 parts with 8 bits at the position (1-base) specified by seed. SEED requires that each element take a value in the range of [1,60], with decrementing no less than 1 between elements. If the number of elements exceeds 8, only the first 8 are taken, and if there are less than 8, an exception is thrown.
seed - pseudo-random seedIllegalArgumentException - After the distinct there are less than 8 elements.public long encode(long number)
Long.MIN_VALUEpublic long decode(long value)
Long.MIN_VALUECopyright © 2024. All rights reserved.