paragonie / sodium-plus

Developer-friendly libsodium interface
Other
170 stars 21 forks source link

crypto.timingSafeEqual missing #46

Open MartijnFLC opened 3 years ago

MartijnFLC commented 3 years ago

When I try to load the following example found in the documentation, there seems to be a missing function.

 // Check that we don't need to rotate hashes
    let stale = await sodium.crypto_pwhash_str_needs_rehash(
        pwhash,
        sodium.CRYPTO_PWHASH_OPSLIMIT_INTERACTIVE,
        sodium.CRYPTO_PWHASH_MEMLIMIT_INTERACTIVE
    );

The code to generate the hash itself works perfectly though

It throws the following error: crypto.timingSafeEqual is not a function (sodium-plus.js:2035:24) I am using version 0.9.0 from unpkg

I am using the browser version and insert the library like this: <script src="~/lib/sodium-plus/dist/sodium-plus.js"></script>