-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
wasm compatability? #25
Comments
On my setup, it works if you disable the default features! Simply add this to your Cargo.toml:
|
That makes sense looks like disable default-features makes it run Sequential Thread Mode https://github.com/sru-systems/rust-argon2/blob/master/src/argon2.rs#L306 #[cfg_attr(feature = "crossbeam-utils", doc = "config.lanes = 4;")]
#[cfg_attr(
feature = "crossbeam-utils",
doc = "config.thread_mode = ThreadMode::Parallel;"
)]
#[cfg_attr(not(feature = "crossbeam-utils"), doc = "config.lanes = 1;")]
#[cfg_attr(
not(feature = "crossbeam-utils"),
doc = "config.thread_mode = ThreadMode::Sequential;"
)] https://docs.sru-systems.com/rust-argon2/0.8.0/argon2/enum.ThreadMode.html |
And this should also the intended behavior for WASM, since multithreading is not supported at the moment(although there are some POC using webworkers and shared-memory, but that requires manual setup on the browser to run) |
One improvement would be to disable the feature when building for wasm32 at the crate level, but this ability juste made it to nightly, so it might take some time until it makes it into stable: |
Currently this crate is not wasm compatible due to use of threads. Would it be possible to add wasm compatability?
The text was updated successfully, but these errors were encountered: