AlphabetMapper (Bouncy Castle Library 1.85 API Specification)
Date: 2026-07-12

org.bouncycastle.crypto

## Interface AlphabetMapper

- All Known Implementing Classes:
    BasicAlphabetMapper

      public interface AlphabetMapper

  Base interface for mapping from an alphabet to a set of indexes suitable for use with FPE.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `char[]` | `convertToChars(byte[] input)` Return a char[] for this alphabet based on the indexes passed.
    `byte[]` | `convertToIndexes(char[] input)` Return the passed in char[] as a byte array of indexes (indexes can be more than 1 byte)
    `int` | `getRadix()` Return the number of characters in the alphabet.

- - ### Method Detail

    - #### getRadix

          int getRadix()

      Return the number of characters in the alphabet.
      Returns:
        the radix for the alphabet.

    - #### convertToIndexes

          byte[] convertToIndexes(char[] input)

      Return the passed in char[] as a byte array of indexes (indexes can be more than 1 byte)
      Parameters:
        `input` - characters to be mapped.
      Returns:
        an index array.

    - #### convertToChars

          char[] convertToChars(byte[] input)

      Return a char[] for this alphabet based on the indexes passed.
      Parameters:
        `input` - input array of indexes.
      Returns:
        an array of char corresponding to the index values.