Class Base32.Encoder

java.lang.Object
org.tquadrat.foundation.util.Base32.Encoder
Enclosing class:
Base32

@ClassVersion(sourceVersion="$Id: Base32.java 1060 2023-09-24 19:21:40Z tquadrat $") @API(status=STABLE, since="0.1.0") public static final class Base32.Encoder extends Object

The Encoder for Crockfords's Base 32 format.

Author:
Thomas Thrien (thomas.thrien@tquadrat.org)
Thanks to:
Douglas Crockford (douglas@crockford.com)
Version:
$Id: Base32.java 1060 2023-09-24 19:21:40Z tquadrat $
Since:
0.1.0
UML Diagram
UML Diagram for "org.tquadrat.foundation.util.Base32.Encoder"

UML Diagram for "org.tquadrat.foundation.util.Base32.Encoder"

UML Diagram for "org.tquadrat.foundation.util.Base32.Encoder"
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
    Creates a new instance of Base32.Encoder.
  • Method Summary

    Modifier and Type
    Method
    Description
    final byte[]
    encode(byte[] value)
    Encodes the given value to Crockford's Base 32.
    final byte[]
    encode(long value)
    Encodes the given value to Crockford's Base 32.
    final byte[]
    encode(String value)
    Encodes the given value to Crockford's Base 32.
    final byte[]
    Encodes the given value to Crockford's Base 32.
    final String
    encodeToString(byte[] value)
    Encodes the given value to a Crockford's Base 32 String.
    final String
    encodeToString(long value)
    Encodes the given value to a Crockford's Base 32 String.
    final String
    Encodes the given value to a Crockford's Base 32 String.
    final String
    Encodes the given value to a Crockford's Base 32 String.

    Methods inherited from class java.lang.Object

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

    • Encoder

      private Encoder()
      Creates a new instance of Base32.Encoder.
  • Method Details

    • encode

      public final byte[] encode(BigInteger value)

      Encodes the given value to Crockford's Base 32.

      This is the converse operation to Base32.Decoder.decode(byte[]).

      Parameters:
      value - The value to encode. It must be a positive number.
      Returns:
      The result.
    • encode

      public final byte[] encode(String value)

      Encodes the given value to Crockford's Base 32.

      This is the converse operation to Base32.Decoder.decodeToString(byte[]).

      Parameters:
      value - The value to encode.
      Returns:
      The result.
    • encode

      public final byte[] encode(byte[] value)

      Encodes the given value to Crockford's Base 32.

      This is the converse operation to Base32.Decoder.decode(byte[]).

      Parameters:
      value - The value to encode.
      Returns:
      The result.
    • encode

      public final byte[] encode(long value)
      Encodes the given value to Crockford's Base 32.
      Parameters:
      value - The value to encode.
      Returns:
      The result.
    • encodeToString

      public final String encodeToString(BigInteger value)

      Encodes the given value to a Crockford's Base 32 String.

      This is the converse operation to Base32.Decoder.decodeToNumber(String).

      Parameters:
      value - The value to encode.
      Returns:
      The result.
    • encodeToString

      public final String encodeToString(String value)

      Encodes the given value to a Crockford's Base 32 String.

      This is the converse operation to Base32.Decoder.decodeToString(String).

      Parameters:
      value - The value to encode.
      Returns:
      The result.
    • encodeToString

      public final String encodeToString(byte[] value)

      Encodes the given value to a Crockford's Base 32 String.

      This is the converse operation to Base32.Decoder.decodeToString(byte[]).

      Parameters:
      value - The value to encode.
      Returns:
      The result.
    • encodeToString

      public final String encodeToString(long value)
      Encodes the given value to a Crockford's Base 32 String.
      Parameters:
      value - The value to encode.
      Returns:
      The result.