Skip to content
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

Async Await #33

Closed
afrancht opened this issue Sep 14, 2019 · 2 comments
Closed

Async Await #33

afrancht opened this issue Sep 14, 2019 · 2 comments

Comments

@afrancht
Copy link

Instead of promises can we use the async await syntax with argon2-browser?

@antelle
Copy link
Owner

antelle commented Sep 14, 2019

Hi! Indeed you can, it's a normal promise, without any hacks.

@antelle antelle closed this as completed Sep 14, 2019
@antelle
Copy link
Owner

antelle commented Sep 14, 2019

(async function() {
    const hash = await argon2.hash({ pass: 'p@ssw0rd', salt: 'somesalt' });
    console.log(hash.encoded);
})();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants