Is there a hash function with the following properties?

  • is associative
  • is not commutative
  • easily implementable on 32 bit integers: int32 hash(int32, int32)

If I am correct, such a function allows achieving the following goals:

  • calculate hash of concatenated string from hashes of substrings
  • calculate hash concurrently
  • calculate hash of list implemented on binary tree - including order, but excluding how tree is balanced

The best I found so far is multiplication of 4x4 matrix of bits, but that's awkward to implement and reduces space to 16 bits.

I am grateful for any help.

Edit
Report