v1
- by bryc 7/3/202300
Setup HTML - click to add setup HTML
disable setup JavaScript
Setup JavaScript
var numA = 123, numB = 123;

function hashCodeA(s) {
    for(var i = 0, h = 0; i < s.length; i++)
        h = Math.imul(31, h) + s.charCodeAt(i) | 0;
    return h;
}
 
function hashCodeB(s) {
  return [...s].reduce(
    (hash, c) => (Math.imul(31, hash) + c.charCodeAt(0)) | 0,
    0
  );
}
delete caserun single casemove downdrag and drop case


ready



hashCodeA("abcd" + numA); numA++;
delete caserun single casemove updrag and drop case


ready



hashCodeB("abcd" + numB); numB++;
Test Case - click to add another test case
Teardown JS - click to add teardown JavaScript
Output (DOM) - click to monitor output (DOM) while test is running
RUN