@Override
	public boolean equals(Object other) {

		if(other == null) {
			return false;
		}
		
		if(other == this) {
			return true;
		}

		byte[] hashedpw = null;
		
		if(other instanceof HashedPassword) {
			hashedpw = ((HashedPassword) other).getHashedPassword();
		} else if (other instanceof byte[]) {
			hashedpw = (byte[]) other;
		} else if (other instanceof String) {
			hashedpw = ((String) other).getBytes();
		}

		return hashedpw != null && MessageDigest.isEqual(hashedPassword, hashedpw);
	}