Closed kurttheviking closed 7 years ago
(Note, it doesn't appear to matter what the seed
value is originally set to.)
Ouch, that's not expected!
I usually develop my code on macOS, and for that OS, there's only one unique key generated per run (as it should). However, I just installed the same version on a Linux server, and I'm getting the same inconsistent results that you are getting.
I'll take a look at it ASAP.
EDIT: the issue occurs when hashing strings, hashing buffers works okay.
I just pushed v2.2.0 to the NPM repo that should fix this issue.
The interesting thing is that this issue also wasn't caught by Travis, which I'm pretty sure isn't running macOS.
@robertklep thanks for the quick turnaround!
I was evaluating this library and one thing caught my eye, not sure if it's intentional or not. In short, given the same input, it appears to be relatively easy to generate inconsistent hashes. For example:
Produced the following output:
If this is expected, I think it might be useful to note in the docs that the hash result is not necessarily the same each run. Thanks!