KUtils
KUTHULU Utilities. This is a shared library of commonly used functions.
append
Joins five strings together.
Input
a, b, c, d, e
string
The strings to be concatenated.
Output
return value
string
The concatenated string.
_toLower
Converts all uppercase characters in a string to lowercase.
Input
str
string
The string to be converted.
Output
return value
string
The converted string.
strlen
Returns the length of a given string.
Input
str
string
The string to get the length.
Output
return value
uint256
The length of the string.
stringsEqual
Compares two strings for equality.
Input
a, b
string
The strings to be compared.
Output
return value
bool
True if the strings are equal, false otherwise.
URI and String Validation
isValidURI
Checks if the given string is a valid URI according to RFC3986 URI Generic Syntax.
Input
str
string
The string to be checked.
Output
return value
bool
True if the string is a valid URI, false otherwise.
isValidGroupString
Checks if the given string is a valid group string.
Input
str
string
The string to be checked.
Output
return value
bool
True if the string is a valid group string, false otherwise.
isValidString
Checks if the given string is a valid string.
Input
str
string
The string to be checked.
Output
return value
bool
True if the string is valid, false otherwise.
Integer to String Conversion
toString
Converts a uint256 value to its string representation.
Input
value
uint256
The value to be converted.
Output
return value
string
The string representation of the input value.
addressToString
Converts an Ethereum address to its string representation.
Input
addr
address
The address to be converted.
Output
return value
string
The string representation of the input address.
Last updated