Java Code Examples for java.security.MessageDigest.toString()

The following are Jave code examples for showing how to use toString() of the java.security.MessageDigest class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: ditb   File: HBaseTestingUtility.java   View Source Code Vote up 5 votes
/**
 * Return an md5 digest of the entire contents of a table.
 */
public String checksumRows(final Table table) throws Exception {
  Scan scan = new Scan();
  ResultScanner results = table.getScanner(scan);
  MessageDigest digest = MessageDigest.getInstance("MD5");
  for (Result res : results) {
    digest.update(res.getRow());
  }
  results.close();
  return digest.toString();
}