类 Base58


  • public class Base58
    extends Object
    作者:
    tag
    • 字段详细资料

      • ALPHABET

        public static final char[] ALPHABET
    • 构造器详细资料

      • Base58

        public Base58()
    • 方法详细资料

      • encode

        public static String encode​(byte[] input)
        Encodes the given bytes as a base58 string (no checksum is appended)./将给定字节编码为Base58字符串(不追加校验和)
        参数:
        input - the bytes to encode
        返回:
        the base58-encoded string
      • decode

        public static byte[] decode​(String input)
                             throws Exception
        Decodes the given base58 string into the original entity bytes./将给定的Base58字符串解码为原始数据字节
        参数:
        input - the base58-encoded string to decode
        返回:
        the decoded entity bytes
        抛出:
        Exception - if the given string is not a valid base58 string
      • decodeToBigInteger

        public static BigInteger decodeToBigInteger​(String input)
                                             throws Exception
        先将给定的Base58字符串解码为原始数据字节,然后再将字节数组转为对应的BigInteger
        参数:
        input - Base58字符串
        抛出:
        Exception
      • decodeChecked

        public static byte[] decodeChecked​(String input)
                                    throws Exception
        Decodes the given base58 string into the original entity bytes, using the checksum in the last 4 bytes of the decoded entity to verify that the rest are correct. The checksum is removed from the returned entity. 将给定的Base58字符串解码为原始数据字节,使用解码数据的最后4字节以验证其余数据是否正确校验和是从返回的数据中删除
        参数:
        input - the base58-encoded string to decode (which should include the checksum)
        返回:
        byte[]
        抛出:
        Exception - if the input is not base 58 or the checksum does not validate.