code: public byte[] digest(String algorithm, byte[] bytes) {
          try {
              MessageDigest md = MessageDigest.getInstance(algorithm);
              return md.digest(bytes);
          }
          catch (NoSuchAlgorithmException exception) {
              throw new IllegalStateException(
                  "unable to access MD5 algorithm", exception
              );
          }
      }
docs: Generates a digest based on the given algorithm.
  
  @param algorithm The algorithm to use (MD5, SHA, etc)
  @param bytes The bytes to digest
  
  @return The associated digest
  
  @see MessageDigest