getBaseXResliceDecoder
Returns a decoder for base-X encoded strings using bit re-slicing.
This decoder deserializes base-X encoded strings by re-slicing the bits of a byte array into custom-sized chunks and mapping them to a specified alphabet. This is typically used for encoding schemes where the alphabet's length is a power of 2, such as base-16 or base-64.
For more details, see getBaseXResliceCodec.
Parameters
| Parameter | Type | Description |
|---|---|---|
alphabet | string | The set of characters defining the base-X encoding. |
bits | number | The number of bits per encoded chunk, typically log2(alphabet.length). |
Returns
VariableSizeDecoder<string>
A VariableSizeDecoder<string> for decoding base-X strings using bit re-slicing.
Example
Decoding a base-X string using bit re-slicing.