Client and backend. This class is shared: the same code is compiled into your app and into your server, so everything on this page works in both.
public final class Base58
- Object
- Base58
Base58 encoding with the Bitcoin alphabet. Each leading zero byte is written
as a leading
1 and vice versa. The conversion works on an int array of
limbs, so it is quadratic in the length but has no big-number allocation.Methods
public static String encode(byte[] input) | Encodes bytes as Base58 text. |
public static byte[] decode(String input) | Decodes Base58 text. |
Inherited methods
Method details
encode
public static String encode(byte[] input)Encodes bytes as Base58 text.
Parameters
inputbyte[]- the bytes to encode
Returns
the Base58 string; empty input gives an empty string
decode
public static byte[] decode(String input)Decodes Base58 text.
Parameters
inputString- the Base58 string
Returns
the decoded bytes
Throws
IllegalArgumentException- if the text holds a character outside the alphabet