Code example for MessageDigest

Methods: digestupdate

	public static byte[] hashBytes( 
		MessageDigest d,
		byte[] b,
		int offset,
		int length) {
		d.update(b, offset, length);
		return d.digest();
	 * Hashes a string in a consistent manner 
	public static byte[] hashString(MessageDigest d, String s) {
		try { 
			byte[] sbytes = s.getBytes("UTF-8");
			d.update(sbytes, 0, sbytes.length);
			return d.digest();
		} catch (Exception e) {
Connect your IDE to all the code out there  Get Codota for Java