Functions of ballerina.util package
public 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 |
public 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 |
public 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 |
public 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 |
public 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 |
public 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 |
public function uuid() (string)
Returns a random UUID string
Return Parameters:
Return Variable | Data Type | Description |
---|---|---|
string | string: The random string |
Structs of ballerina.util package
public struct Locale
Locale struct represents specific geographical, political, or cultural region.
Fields:
Field Name | Data Type | Description |
---|---|---|
language | string | The language field for Locale |
countryCode | string | The countryCode field for Locale |