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 Base58Check
- Object
- Base58Check
Base58Check: Base58 text of a payload followed by the first four bytes of its
double SHA-256 digest. Used for Bitcoin legacy addresses and WIF keys.
Methods
public static String encode(byte[] payload) | Appends the checksum to a payload and encodes the result. |
public static byte[] decode(String text) | Decodes Base58Check text, verifies the checksum and strips it. |
Inherited methods
Method details
encode
public static String encode(byte[] payload)Appends the checksum to a payload and encodes the result.
Parameters
payloadbyte[]- the version byte(s) and data
Returns
the Base58Check string
decode
public static byte[] decode(String text)Decodes Base58Check text, verifies the checksum and strips it.
Parameters
textString- the Base58Check string
Returns
the payload without the checksum
Throws
IllegalArgumentException- if the text is malformed, too short or the checksum is wrong