public class Base58 extends Object
encode(byte[]) and decode(String) methods are non-static
simply to accommodate possible future compatibility with Apache Commons-Codec.| 构造器和说明 |
|---|
Base58() |
| 限定符和类型 | 方法和说明 |
|---|---|
byte[] |
decode(String source) |
byte[] |
decode(String source,
int numBytes) |
static byte[] |
decodeString(String source)
Decode a Base58-encoded value into bytes.
|
static byte[] |
doDecode(String source,
int numBytes)
Decode a Base58-encoded value into the specified number of bytes, MSB first (with zero-padding at the front).
|
String |
encode(byte[] source) |
String |
encode(long value) |
static String |
encodeToString(byte[] source)
Encode a stream of MSB-ordered bytes into Base58.
|
static String |
encodeToString(long value)
Convenience method to encode a
long value. |
public static String encodeToString(byte[] source)
source - the bytes to be encodedpublic String encode(byte[] source)
public static String encodeToString(long value)
long value. Converts the value into a byte array and calls encode(byte[]).value - the number to be encodedpublic String encode(long value)
public static byte[] decodeString(String source)
decode(String, int) to front-pad to a specific length. If the original value encoded was negative, this
method will return a leading zero byte added as padding.source - a Base58-encoded valuepublic byte[] decode(String source)
public static byte[] doDecode(String source, int numBytes)
source - a Base58-encoded valuenumBytes - the size of the byte array to be returnedpublic byte[] decode(String source, int numBytes)
Copyright © 2021. All rights reserved.