code: private byte[] calculateHash(String data) throws NoSuchAlgorithmException, UnsupportedEncodingException {
          MessageDigest md = MessageDigest.getInstance(HASH_ALGORITHM);
          md.update(data.getBytes(ENCODING));
          return md.digest();
      }
docs: Calculates the message digest (hash) for the data string.
  
  @param data String for which the digest will be calculated.
  @return Digest's bytes. This result is not encoded.