Refactor StringUtils to provide message digest in common function
The calculation of a MD5 and SHA-1 sum are all message digest implementations.
Instead or replicating the same code over and over again, provide a
common function for message digest calculation which can do this for
different algorithms based on the algorithm name passed as a parameter.
Then replace the existing `getMD5` and `getSHA1` functions by calling
the common function passing the respective algorithm name.