I am attempting to SHA3 a password. It works, and I make the hash.
var hash = CryptoJS.SHA3(pass, { outputLength: 512});
console.log(hash.toString());
and the result is:
8ca32d950873fd2b5b34a7d79c4a294b2fd805abe3261beb04fab61a3b4b75609afd6478aa8d34e03f262d68bb09a2ba9d655e228c96723b2854838a6e613b9d
which is what I want.
The issue is that this code is in this:
this.pass = require(["crypto-js"], function(CryptoJS) {
console.log(pass);
var hash = CryptoJS.SHA3(pass, { outputLength: 512});
console.log(hash.toString());
return hash.toString();
});
Which doesn't actually set my variable to it. I instead get the function.
I've now sat here for probably 6-7 hrs trying random stuff.
I know it doesn't make sense the way I'm doing it, but I included require as a script tag in html. This is because I'm not actually running an npm server. This is also a browser extension. I am also aware my title makes it sound like "I'm right, code is wrong" trust me I know I'm wrong just please help me.
Tried various forms of setting this.pass. Tried to pass in this.pass. Tried setting this.pass inside the function. I don't know anymore.