Skip to content

Commit

Permalink
fix: joaat calculator (#3)
Browse files Browse the repository at this point in the history
* fix: joaat calc

* remove console.log

* rename to hash

* make code cleaner
  • Loading branch information
MellKam authored Apr 21, 2024
1 parent 0314041 commit fb01484
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/Joaat/Joaat.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ function JOAATCalculator() {
const [showKarby, setShowKarby] = useState(false);

const calculateJOAAT = (str) => {
str = str.toLowerCase();
let hash = 0;

for (let i = 0; i < str.length; i++) {
const char = str.charCodeAt(i);
hash += char;
hash += str.charCodeAt(i);
hash += (hash << 10);
hash ^= (hash >>> 6);
}
Expand Down

0 comments on commit fb01484

Please sign in to comment.