# [Ride v5] Encoding functions
⚠️ This is the documentation for the Standard library version 5. We recommend to use version 6. Go to version 6
Name | Description | Complexity |
---|---|---|
toBase16String(ByteVector): String | Encodes array of bytes to base16 string | 10 |
toBase58String(ByteVector): String | Encodes array of bytes to base58 string | 3 |
toBase64String(ByteVector): String | Encodes array of bytes to base64 string | 35 |
# toBase16String(ByteVector): String
Encodes an array of bytes to a base16 string.
toBase16String(bytes: ByteVector): String
# Parameters
Parameter | Description |
---|---|
bytes : ByteVector | Array of bytes to encode. Up to 8 Kbytes |
# Examples
toBase16String("Ride".toBytes()) # Returns "52696465"
toBase16String(base16'52696465') # Returns "52696465"
# toBase58String(ByteVector): String
Encodes an array of bytes to a base58 string.
toBase58String(bytes: ByteVector): String
# Parameters
Parameter | Description |
---|---|
bytes : ByteVector | Array of bytes to encode. Up to 64 bytes |
# Examples
toBase58String("Ride".toBytes()) # Returns "37BPKA"
toBase58String(base58'37BPKA') # Returns "37BPKA"
# toBase64String(ByteVector): String
Encodes an array of bytes to a base64 string. Fails if the size of the resulting string exceeds 32 Kbytes.
toBase64String(bytes: ByteVector): String
# Parameters
Parameter | Description |
---|---|
bytes : ByteVector | Array of bytes to encode. Up to 32 Kbytes |
# Examples
toBase64String("Ride".toBytes()) # Returns "UmlkZQ=="
toBase64String(base64'UmlkZQ==') # Returns "UmlkZQ=="