I'm not sure how important performance is here, but this is building a StringBuffer, appending values into a String and then pushing that into the digest, essentially materializing a copy of the concatenated object every time this runs.  It should be possible to append each thing to the digest and get the value out that way instead of concatenating everything together like this.