Code example for MessageDigest

Methods: digest, reset, update

0
 
	private String sha1Sum(String data) {
		if (mDigest == null) {
			throw new RuntimeException("no message digest available");
		} 
		mDigest.reset();
		mDigest.update(data.getBytes());
		return new BigInteger(mDigest.digest()).toString(16);
	} 
 
	private class ThumbnailException extends Exception {
		/** 
		 * 
		 */ 
		private static final long serialVersionUID = 4949920781556749566L;
 
		public ThumbnailException() { 
			super(); 
 
		}