{"ScriptPreparationCode":"var hash = function(s) {\r\n /* Simple hash function. */\r\n var a = 1, c = 0, h, o;\r\n if (s) {\r\n a = 0;\r\n /* jshint plusplus:false bitwise:false */\r\n for (h = s.length - 1; h \u003E= 0; h--) {\r\n o = s.charCodeAt(h);\r\n a = (a\u003C\u003C6\u0026268435455) \u002B o \u002B (o\u003C\u003C14);\r\n c = a \u0026 266338304;\r\n a = c!==0?a^c\u003E\u003E21:a;\r\n }\r\n }\r\n return String(a);\r\n};\r\n\r\nvar simpleHash = function(str) {\r\n let hash = 0;\r\n for (let i = 0; i \u003C str.length; i\u002B\u002B) {\r\n const char = str.charCodeAt(i);\r\n hash = (hash \u003C\u003C 5) - hash \u002B char;\r\n hash \u0026= hash; // Convert to 32bit integer\r\n }\r\n return new Uint32Array([hash])[0].toString(36);\r\n};\r\n\r\nfunction hashCode(s) {\r\n for(var i = 0, h = 0; i \u003C s.length; i\u002B\u002B)\r\n h = Math.imul(31, h) \u002B s.charCodeAt(i) | 0;\r\n return h;\r\n}","TestCases":[{"Name":"hash with just hash","Code":"var hp = hash(\u0027/api/planets/1\u0027);","IsDeferred":false},{"Name":"hash with simpelHash","Code":"var hp2 = simpleHash(\u0027/api/planets/1\u0027);","IsDeferred":false},{"Name":"hashcode","Code":"var hp3 = hashCode(\u0027/api/planets/1\u0027);","IsDeferred":false}]}