As the code wrote, this function is most likely a hash function , name it to 'stringToNumber' may lead the one who use it to 'convert string to number'.
function stringToNumber()
{
local -r string="${1}"
checkNonEmptyString "${string}" 'undefined string'
if [[ "$(existCommand 'md5')" = 'true' ]]
then
md5 <<< "${string}" | tr -cd '0-9'
elif [[ "$(existCommand 'md5sum')" = 'true' ]]
then
md5sum <<< "${string}" | tr -cd '0-9'
else
fatal '\nFATAL : md5 or md5sum command not found'
fi
}
As the code wrote, this function is most likely a hash function , name it to 'stringToNumber' may lead the one who use it to 'convert string to number'.
https://github.com/gdbtek/linux-cookbooks/blob/master/libraries/util.bash