code: public String digest(String message) {
  		final byte[] messageAsByteArray;
  
  		try {
  			messageAsByteArray = message.getBytes(charsetName);
  		} catch (UnsupportedEncodingException e) {
  			throw new DigestException("error converting message to byte array: charsetName=" + charsetName, e);
  		}
  
  		final byte[] digest = digest(messageAsByteArray);
  
  		switch (outputMode) {
  			case BASE64:
  				return Base64.encodeBase64String(digest);
  			case HEX:
  				return Hex.encodeHexString(digest);
  			default:
  				return null;
  		}
  	}
docs: Returns the message digest. The representation of the message digest
  depends on the outputMode property.
  
  @param message the message
  @return the message digest
  @see #setOutputMode(OutputMode)