java.lang.Object
com.predic8.membrane.core.interceptor.authentication.session.totp.Base32String

public class Base32String extends Object
Encodes arbitrary byte arrays as case-insensitive base-32 strings.

The implementation is slightly different than in RFC 4648. During encoding, padding is not added, and during decoding the last incomplete chunk is not taken into account. The result is that multiple strings decode to the same byte array, for example, string of sixteen 7s ("7...7") and seventeen 7s both decode to the same byte array. TOD O(sarvar): Revisit this encoding and whether this ambiguity needs fixing.

Source: ... License: ASL 2.0

Author:
sweis@google.com (Steve Weis), Neal Gafter
  • Constructor Details

    • Base32String

      protected Base32String(String alphabet)
  • Method Details

    • getInstance

      public static Base32String getInstance()
    • decode

      public static byte[] decode(String encoded)
    • decodeInternal

      protected byte[] decodeInternal(String encoded)
    • encode

      public static String encode(byte[] data)
    • encodeInternal

      protected String encodeInternal(byte[] data)