public final class BaseNRemainderEncoder extends BaseNEncoder
It encodes using remainder operator (modulus), a common approach to encode integers.
The encoding process is performed using integer arithmetic.
| Modifier and Type | Field and Description |
|---|---|
protected BaseNCodec.CustomDivider |
divider
A custom divider for optimization.
|
alphabet, base| Constructor and Description |
|---|
BaseNRemainderEncoder(BaseN base)
Constructor with a base-n.
|
BaseNRemainderEncoder(BaseN base,
BaseNCodec.CustomDivider divider)
Constructor with a base-n and a custom divider.
|
| Modifier and Type | Method and Description |
|---|---|
String |
apply(UUID uuid) |
protected static long[] |
divide(long x,
BaseNCodec.CustomDivider divider,
long rem)
Divide a long as unsigned 64 bit integer
|
getprotected final BaseNCodec.CustomDivider divider
public BaseNRemainderEncoder(BaseN base)
base - a base-npublic BaseNRemainderEncoder(BaseN base, BaseNCodec.CustomDivider divider)
base - a base-ndivider - a custom dividerprotected static long[] divide(long x,
BaseNCodec.CustomDivider divider,
long rem)
x - a number to be divideddivider - a custom dividerrem - the reminderCopyright © 2024. All rights reserved.