java.lang.Object
org.seppiko.commons.utils.codec.BaseNCodec
org.seppiko.commons.utils.codec.Base32
All Implemented Interfaces:
Serializable

public class Base32 extends BaseNCodec implements Serializable
Base32 encoding and decoding.
Author:
Leonard Woo
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected static final char
     
    static final Base32
    The most widely used Base32 alphabet is defined in RFC 4648.
    static final Base32
    The most widely used Base32 alphabet is defined in RFC 4648.
    static final Base32
    z-base-32 is a Base32 encoding designed by Zooko Wilcox-O'Hearn to be easier for human use and more compact.

    Fields inherited from class org.seppiko.commons.utils.codec.BaseNCodec

    MASK_4BITS, MASK_5BITS, MASK_8BITS
  • Method Summary

    Modifier and Type
    Method
    Description
    byte[]
    Decode the Base32-encoded data in input and return the data in a new byte array.
    encode(byte[] source)
    Base32-encode the given data and return a newly allocated String with the result.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • PADDING

      protected static final char PADDING
    • RFC4648

      public static final Base32 RFC4648
      The most widely used Base32 alphabet is defined in RFC 4648. It uses an alphabet of A–Z, followed by 2–7. The digits 0, 1 and 8 are skipped due to their similarity with the letters O, I and B (thus "2" has a decimal value of 26).
    • RFC4648_HEX

      public static final Base32 RFC4648_HEX
      The most widely used Base32 alphabet is defined in RFC 4648. It uses a digit of 0-9, followed by A–V.
    • ZBASE32

      public static final Base32 ZBASE32
      z-base-32 is a Base32 encoding designed by Zooko Wilcox-O'Hearn to be easier for human use and more compact. It includes 1, 8 and 9 but excludes l, v and 2. It also permutes the alphabet so that the easier characters are the ones that occur more frequently. It compactly encodes bitstrings whose length in bits is not a multiple of 8 and omits trailing padding characters. z-base-32 was used in the Mnet open source project, and is currently used in Phil Zimmermann's ZRTP protocol, and in the Tahoe-LAFS open source project.
  • Method Details