indutny / hash.js

Hash functions in pure javascript
317 stars 42 forks source link

why it is wrong ? #15

Open ying2025 opened 6 years ago

ying2025 commented 6 years ago

I want to compute SHA1(salt | SHA1(identity | ":" | pass)) cli.hasher = hash.sha1; var h = cli.hasher(); var buf1 = h.update(cli.identity + ':' + cli.pass).digest('hex'); // console.log("XXX", buf1)

    var h2 = cli.hasher();
    var buf2 = h2.update(cli.salt).digest('hex');
    console.log("buf2", buf2)

    var h3 = cli.hasher();
    var buf3 = h3.update(buf1).update(buf2).digest('hex');
    console.log("buf3", buf3)
indutny commented 6 years ago

Do you know what | means? Does the place where you got this string from contain any information?