function hashCode(str) {
        var hash = 0, i, chr, len;
        if (str.length === 0) {
            return hash;
        }
        for (i = 0, len = str.length; i < len; i++) {
            chr   = str.charCodeAt(i);
            hash  = ((hash << 5) - hash) + chr;
            hash |= 0; // Convert to 32bit integer
        }
        return hash;
    }
Computes a 32bit hash from the given string
Taken from http://stackoverflow.com/questions/7616461/generate-a-hash-from-string-in-javascript-jquery
@CC wiki attribution: esmiralha
@param   {string}   str The string for which hash is to be computed
@return {number} The 32-bit hash