Example usage for java.security MessageDigest toString

List of usage examples for java.security MessageDigest toString

Introduction

In this page you can find the example usage for java.security MessageDigest toString.

Prototype

public String toString() 

Source Link

Document

Returns a string representation of this message digest object.

Usage

From source file:org.apache.hadoop.hbase.HBaseTestingUtility.java

/**
 * Return an md5 digest of the entire contents of a table.
 *//*w w  w. j  a v  a2  s.c  o m*/
public String checksumRows(final HTable 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();
}