Class Base58

java.lang.Object
com.codename1.crypto.encoding.Base58

public final class Base58 extends Object
Base58 encoding with the Bitcoin alphabet. Each leading zero byte is written as a leading 1 and vice versa. The conversion works on an int array of limbs, so it is quadratic in the length but has no big-number allocation.
  • Method Details

    • encode

      public static String encode(byte[] input)

      Encodes bytes as Base58 text.

      Parameters
      • input: the bytes to encode
      Returns

      the Base58 string; empty input gives an empty string

    • decode

      public static byte[] decode(String input)

      Decodes Base58 text.

      Parameters
      • input: the Base58 string
      Returns

      the decoded bytes

      Throws
      • IllegalArgumentException: if the text holds a character outside the alphabet