Could you add a couple of comments to this function? There are some subtle parts to it, especially the `hash = hash & hash` line, which I gather is forcing the JS engine to turn `hash` into a 32-bit integer.