Crypto
Fingerprint data, sign messages, derive keys, store passwords and add a second factor, all on the Web Crypto API.
Each page here does one job and comes with code you can copy into your app. If you're not sure which job is yours, the table in Concepts sorts them by what you're trying to do.
Hash data
Fingerprint content with SHA-256 to tell whether it changed.
Sign and verify messages
Prove a message came from someone holding a shared secret.
Derive keys
Turn one root secret into a separate key per purpose.
Store passwords
Hash passwords with Argon2 and check them at login.
Add a second factor
Enroll an authenticator app and accept each six-digit code once.