public static byte[] hashWithAlg(String algorithm, byte[]... args) {
    try {
      MessageDigest md = MessageDigest.getInstance(algorithm);
      for (byte[] arg : args) {
        md.update(arg);
      }
      return md.digest();
    } catch (NoSuchAlgorithmException e) {
      throw new RuntimeException("unable to use hash algorithm: " + algorithm, e);
    }
  }
Return the hash of the concatenation of the supplied arguments, using the hash algorithm
provided.
hbase-common/src/main/java/org/apache/hadoop/hbase/io/crypto/Encryption.java