Functions of ballerina.utils package
function base64ToBase16Encode(string baseString) (string )
Encodes a Base64 encoded string into a Base16 encoded string.
Parameters:
Parameter Name | Data Type | Description |
---|---|---|
baseString | string | The input string to be encoded |
Return Parameters:
Return Variable | Data Type | Description |
---|---|---|
string | string: The Base16 encoded string |
function base64decode(string s) (string )
Decodes a Base64 encoded string to a new string
Parameters:
Parameter Name | Data Type | Description |
---|---|---|
s | string | The input string to be decoded |
Return Parameters:
Return Variable | Data Type | Description |
---|---|---|
string | string: The decoded string |
function base64encode(string s) (string )
Encodes the specified string into a string using the Base64 scheme
Parameters:
Parameter Name | Data Type | Description |
---|---|---|
s | string | The input string to be encoded |
Return Parameters:
Return Variable | Data Type | Description |
---|---|---|
string | string: The encoded string |
function getHash(string baseString, string algorithm) (string )
Returns a hash of a given string using the SHA-256 algorithm
Parameters:
Parameter Name | Data Type | Description |
---|---|---|
baseString | string | The string to be hashed |
algorithm | string | The hashing algorithm to be used |
Return Parameters:
Return Variable | Data Type | Description |
---|---|---|
string | string: The hashed string |
function getHmac(string baseString, string keyString, string algorithm) (string )
Returns a hash of a given string using the key provided
Parameters:
Parameter Name | Data Type | Description |
---|---|---|
baseString | string | The string to be hashed |
keyString | string | The key string |
algorithm | string | The hashing algorithm to be used |
Return Parameters:
Return Variable | Data Type | Description |
---|---|---|
string | string: The hashed string |
function getHmacFromBase64(string baseString, string keyString, string algorithm) (string )
Returns a hash of a given string in Base64 format using the key provided
Parameters:
Parameter Name | Data Type | Description |
---|---|---|
baseString | string | The string to be hashed |
keyString | string | The key string |
algorithm | string | The hashing algorithm to be used |
Return Parameters:
Return Variable | Data Type | Description |
---|---|---|
string | string: The hashed string |
function getRandomString() (string )
Returns a random UUID string
Parameters:
Parameter Name | Data Type | Description |
---|
Return Parameters:
Return Variable | Data Type | Description |
---|---|---|
string | string: The random string |