antelle / argon2-browser

Argon2 library compiled for browser runtime
https://antelle.net/argon2-browser
MIT License
367 stars 79 forks source link

How to use wasm? #21

Closed taoxinyi closed 5 years ago

taoxinyi commented 5 years ago

I change loadScript(distPath + '/argon2-asm.min.js'); to loadScript(distPath + '/argon2.min.js');, then I can see argon2.wasm is successfully fetched in the browser, but it shows error Cannot read property 'apply' of undefined when using argon.hash.

Is there an easy way to use wasm?

antelle commented 5 years ago

Hi! There's an example here: https://github.com/antelle/argon2-browser/blob/master/docs/js/calc.js#L67