Code example for Mac

Methods: doFinal, init

0
	@Override 
	public byte[] computeHash(byte[] password, byte[] salt) {
		if (!initialized)
			init(password);
		 
		return mac.doFinal(salt);
	} 
	 
	public void init(byte[] password) {
		try { 
			mac.init(new SecretKeySpec(password, algorithm));
			this.initialized = true;
		} 
		 
		catch (InvalidKeyException e) {
			e.printStackTrace();
		} 
	} 
	 
	@Override 
	public void reset() {