# Decoding functions
Name | Description | Complexity |
---|---|---|
addressFromString(String): Address|Unit | Decodes address from base58 string | 1 |
addressFromStringValue(String): Address | Decodes address from base58 string. Fails if the address cannot be decoded | 1 |
fromBase16String(String): ByteVector | Decodes base16 string to an array of bytes | 10 |
fromBase58String(String): ByteVector | Decodes base58 string to an array of bytes | 1 |
fromBase64String(String): ByteVector | Decodes base64 string to an array of bytes | 40 |
# addressFromString(String): Address|Unit
Decodes address from base58 string.
addressFromString(string: String): Address|Unit
For a description of the return value, see the Address article.
# Parameters
Parameter | Description |
---|---|
string : String | String to decode |
# Examples
let address = addressFromString("3NADPfTVhGvVvvRZuqQjhSU4trVqYHwnqjF")
# addressFromStringValue(String): Address
Decodes address from base58 string.
Fails if the address cannot be decoded.
addressFromStringValue(string: String): Address
For a description of the return value, see the Address article.
# Parameters
Parameter | Description |
---|---|
string : String | String to decode |
# Examples
let address = addressFromStringValue("3NADPfTVhGvVvvRZuqQjhSU4trVqYHwnqjF")
# fromBase16String(String): ByteVector
Decodes a base16 string to an array of bytes.
fromBase16String(str: String): ByteVector
# Parameters
Parameter | Description |
---|---|
str : String | String to decode |
# Examples
let bytes = fromBase16String("52696465")
# fromBase58String(String): ByteVector
Decodes a base58 string to an array of bytes.
fromBase58String(str: String): ByteVector
# Parameters
Parameter | Description |
---|---|
str : String | String to decode. Up to 100 characters |
# Examples
let bytes = fromBase58String("37BPKA")
# fromBase64String(String): ByteVector
Decodes a base64 string to an array of bytes.
fromBase64String(str: String): ByteVector
# Parameters
Parameter | Description |
---|---|
str : String | String to decode |
# Examples
let bytes = fromBase64String("UmlkZQ==")