You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've tried to use the jsSHA SHA-1 implementation in node but had a weird bug.
An earlier implementation of the same method in the browser works as expected.
I wrote a small nodeunit test that uses jsSHA and node crypto to hash the same input.
Reading your script, you have a function called hex2bin and you pass its output to jsSHA with type "TEXT" If you just pass the string as-is (without hex2bin) and set its type to "HEX" you should be set.
I honestly have no idea how it would have worked in the browser as it is currently written.
It looks like you may be using a slightly order version of the library. The most recently version (1.5) has slightly better Node support and I shrunk the file size quite a bit. Also, it has the ability to output uppercase HEX strings.
I've tried to use the jsSHA SHA-1 implementation in node but had a weird bug.
An earlier implementation of the same method in the browser works as expected.
I wrote a small nodeunit test that uses jsSHA and node crypto to hash the same input.
Running the script in nodeunit I get:
If there's something wrong with the implementation just tell me 👍
The text was updated successfully, but these errors were encountered: