jedisct1 / libsodium.js

libsodium compiled to Webassembly and pure JavaScript, with convenient wrappers.
Other
968 stars 138 forks source link

crypto_pwhash_str is not a function #313

Closed atomrc closed 1 year ago

atomrc commented 1 year ago

Since the upgrade from 0.7.10 to 0.7.11 the crypto_pwhash_str function doesn't seem to be exposed anymore.

Uncaught (in promise) TypeError: libsodium_wrappers__WEBPACK_IMPORTED_MODULE_2___default(...).crypto_pwhash_str is not a function

Could there have been a breaking change introduced with 0.7.11?

TheBinaryGuy commented 1 year ago

Yes, ran into the same issue, you need libsodium-wrappers-sumo since 0.7.11. See: #312 Also check out: https://github.com/jedisct1/libsodium.js/commit/d297e49dd804bfb7c664cd58be1cdf012e0f3aea

Jack-Edwards commented 1 year ago

Is password hashing supported at all in the non-sumo version? I encounter the same error with crypto_pwhash. The function is not available.

Edit: #312 explains it.

jedisct1 commented 1 year ago

The README file, too: https://github.com/jedisct1/libsodium.js#standard-vs-sumo-version

webmaster128 commented 1 year ago

FYI: The latest version of @types/libsodium-wrappers 0.7.10 still has the crypto_pwhash symbols, which might confuse some users as it will pass at comepile time and fail at runtime.