for (i = 0; i < str.length; i++) {
          c = str.charCodeAt(i);
          hash = c + (hash << 6) + (hash << 16) - hash;
        }