No problem, and actually this is the Javascript implementation of Java’s String.hashCode() method, I just borrow and use it here. And for `hash = hash & hash` line you are correct, it's converting the hash to 32-bit integer.

Do you know there are some other code that also using some hash function in gaia? probably we should just use the existing hash function from the other apps, maybe email app got one?