类 Base58
- java.lang.Object
-
- network.nerve.core.crypto.Base58
-
public class Base58 extends Object
- 作者:
- tag
-
-
字段概要
字段 修饰符和类型 字段 说明 static char[]ALPHABET
-
构造器概要
构造器 构造器 说明 Base58()
-
方法概要
所有方法 静态方法 具体方法 修饰符和类型 方法 说明 static byte[]decode(String input)Decodes the given base58 string into the original entity bytes.static byte[]decodeChecked(String input)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.static BigIntegerdecodeToBigInteger(String input)先将给定的Base58字符串解码为原始数据字节,然后再将字节数组转为对应的BigIntegerstatic Stringencode(byte[] input)Encodes the given bytes as a base58 string (no checksum is appended).
-
-
-
方法详细资料
-
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.
-
-