Package org.nervos.muta.util
Class Bech32Util
- java.lang.Object
-
- org.nervos.muta.util.Bech32Util
-
public class Bech32Util extends java.lang.Object
following code is copied from bitcoinJ and https://github.com/sipa/bech32/pull/40/
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
HRP
-
Constructor Summary
Constructors Constructor Description Bech32Util()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static byte[]
decodeAddress(java.lang.String address, java.lang.String hrp_prefix)
decode Bech32 addressstatic java.lang.String
encodeAddress(byte[] code, java.lang.String hrp_prefix)
encode address data with pre-set hrp
-
-
-
Method Detail
-
decodeAddress
public static byte[] decodeAddress(java.lang.String address, java.lang.String hrp_prefix)
decode Bech32 address- Parameters:
address
- bech32 addresshrp_prefix
- hrp prefix, if null, use default- Returns:
- address contains in bech32 format
-
encodeAddress
public static java.lang.String encodeAddress(byte[] code, java.lang.String hrp_prefix)
encode address data with pre-set hrp- Parameters:
code
- raw address datahrp_prefix
- hrp prefix, if null, use default- Returns:
- bech32 address
-
-