public final class Base58 extends Object
This utility class implements a base58 encoding with the alphabet from bitcoin.
This class is thread safe.
Modifier and Type | Method and Description |
---|---|
static byte[] |
decode(String data)
Convert the Base58 string into a byte array.
|
static byte |
divide(byte[] dividend,
int base,
int divisor)
A helper method to divide the dividend (in the byte array) by a divisor.
|
static String |
encode(byte[] data)
Convert the data into a Base58 string.
|
public static String encode(byte[] data)
Convert the data into a Base58 string.
data
- the data to encode.public static byte[] decode(String data)
Convert the Base58 string into a byte array.
data
- the base58 string to convert back into a byte array.public static byte divide(byte[] dividend, int base, int divisor)
A helper method to divide the dividend (in the byte array) by a divisor. The elements of the byte array are treated as figures to the given base.
dividend
- the dividend of the division. Contains the quotient of the division after the method is finished.base
- the base (max 256) of the digits in the number (each element is a digit).divisor
- the divisor (max 256) of the division.Copyright © 2020 sw4j.org. All rights reserved.