A particular type of hash on a String concatenation
===

I need a specialised hash function h(X,Y) in Java with the following properties.

 1. X and Y are strings.
 2. h(X,Y) = h(Y,X).
 3. X and Y are arbitrary length strings and there is no length limit on the result of h(X,Y) either.
 4. h(X,Y) and h(Y,X) should not collide with h(A,B) = h(B,A) if X is not equal to A and Y is not equal to B.
 5. h() does not need to be a secure hash function unless it is necessary to meet the aforementioned requirements.

In my mind, I see requirements 2 and 4 slightly contradictory but perhaps I am worrying too much.

At the moment, what I am doing in Java is the following:

    public static BigInteger hashStringConcatenation(String str1, String str2) {
		BigInteger bA = BigInteger.ZERO;
		BigInteger bB = BigInteger.ZERO;
		for(int i=0; i<str1.length(); i++) {
			bA = bA.add(BigInteger.valueOf(127L).pow(i+1).multiply(BigInteger.valueOf(str1.codePointAt(i))));
		}
		for(int i=0; i<str2.length(); i++) {
			bB = bB.add(BigInteger.valueOf(127L).pow(i+1).multiply(BigInteger.valueOf(str2.codePointAt(i))));
		}
		return bA.multiply(bB);
	}

I think this is hideous but that's why I am looking for nicer solutions. Thanks.