Code example for MessageDigest

Methods: reset

0
	 * @throws NoSuchAlgorithmException  
	 */ 
	public MD5Hash() throws NoSuchAlgorithmException 
	{ 
		md = MessageDigest.getInstance("MD5");
		md.reset();
	} 
	 
	/** 
	 * Gets 32 character MD5 Hash String for the given key. 
	 * @param key String for which Hash code is to be computed. 
	 * @return String representing MD5 Hash code. 
	 */ 
	public String getStringHash(String key)
	{ 
		String source = key;
		md.update(source.getBytes());
		digest = md.digest();
		bigInt = new BigInteger(1,digest);
		hash = bigInt.toString(16);
		while(hash.length()<32)