getBaseXCodec function

VariableSizeCodec<String, String> getBaseXCodec(
  1. String alphabet
)

Returns a codec for encoding and decoding base-X strings.

This codec serializes strings using a custom alphabet, treating the length of the alphabet as the base.

This codec supports leading zeroes by treating the first character of the alphabet as the zero character.

Implementation

VariableSizeCodec<String, String> getBaseXCodec(String alphabet) {
  return combineCodec(getBaseXEncoder(alphabet), getBaseXDecoder(alphabet))
      as VariableSizeCodec<String, String>;
}