So I have a function called sha256 which will take a string and return the SHA-256 hash.
var First = sha256('myfirstSHA');
And the output is the hex:
All feels good here, but if I want a double SHA-256 how should I go abut calculating it? Can I just use the same function as above twice? like this...
var Second = sha256(sha256('myfirstSHA'));
What should the value of Second be?
I get the feeling I may need to get the value of the first hash and convert it to something before putting it back through the sha-256 function a second time??
So my question is, what should I convert it to, before feeding it back in again?
Any advice is most welcome!