public class LongCounterNonce extends java.lang.Object implements Nonce
Instances of this class are thread safe.
BigIntegerCounterNonce| Modifier and Type | Field and Description |
|---|---|
private java.util.concurrent.atomic.AtomicLong |
counter
Counter.
|
| Constructor and Description |
|---|
LongCounterNonce()
Creates a new instance whose counter values start at 1.
|
LongCounterNonce(long start)
Creates a new instance whose counter values start above the given value.
|
| Modifier and Type | Method and Description |
|---|---|
byte[] |
generate()
Generates a nonce value.
|
int |
getLength() |
public LongCounterNonce()
public LongCounterNonce(long start)
start - Start value.public byte[] generate()
throws LimitException
Noncegenerate in interface NonceLimitException - When a limit imposed by the nonce generation strategy, if any, is exceeded.