Class Base58Provider
java.lang.Object
org.miaixz.bus.core.codec.binary.provider.Base58Provider
- All Implemented Interfaces:
Serializable,Decoder<CharSequence,,byte[]> Encoder<byte[],String>
public class Base58Provider
extends Object
implements Encoder<byte[],String>, Decoder<CharSequence,byte[]>, Serializable
Base58编码器
此编码器不包括校验码、版本等信息
- Since:
- Java 17+
- Author:
- Kimi Liu
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbyte[]decode(CharSequence encoded) 解码给定的Base58字符串static bytedivmod(byte[] number, int firstDigit, int base, int divisor) Divides a number, represented as an array of bytes each containing a single digit in the specified base, by the given divisor.encode(byte[] data) Base58编码
-
Field Details
-
INSTANCE
单例
-
-
Constructor Details
-
Base58Provider
public Base58Provider()
-
-
Method Details
-
divmod
public static byte divmod(byte[] number, int firstDigit, int base, int divisor) Divides a number, represented as an array of bytes each containing a single digit in the specified base, by the given divisor. The given number is modified in-place to contain the quotient, and the return value is the remainder.- Parameters:
number- the number to dividefirstDigit- the index within the array of the first non-zero digit (this is used for optimization by skipping the leading zeros)base- the base in which the number's digits are represented (up to 256)divisor- the number to divide by (up to 256)- Returns:
- the remainder of the division operation
-
encode
Base58编码 -
decode
解码给定的Base58字符串- Specified by:
decodein interfaceDecoder<CharSequence,byte[]> - Parameters:
encoded- Base58编码字符串- Returns:
- 解码后的bytes
- Throws:
IllegalArgumentException- 非标准Base58字符串
-