I'm sorry, I wasn't clear.

I meant that having Constants.newMessageDigest() seems like the wrong place to put a 'newMessageDigest()' constructor, particularly if Constants is otherwise a class that just contains, well, constants.

I agree we need to instantiate a new message digest at this point. But I think the factory belongs somewhere else; maybe even a MessageDigets class that we instantiate here directly with new MessageDigest().