Auth and security libraries: live code examples
10 examples for 2 libraries. Open one to read how it works, run it in your browser and change it, by hand or with AI.
All 231 examples UI components and icons Utilities Forms, validation and schemas Animation and motion 3D and graphics Web frameworks State and data fetching Markdown, editors and content Files, images and media Styling and CSS Charts and data visualisation HTTP clients and networking Game development
bcryptjs 5 examples · usage and stats
Hashing and checking a password with bcryptjsChange the password or the guess and run again; the salt and hash are different on every run.
Synchronous hashing in bcryptjsRun it twice: the two hashes differ every time, but both compareSync checks print true.
Salt rounds and cost in bcryptjsWatch the milliseconds grow with each round count; add 13 to the list to see it climb further.
Checking the 72-byte limit with bcryptjsEdit the samples or make the long password shorter than 72 bytes and see truncates flip to false.
Hash progress and callbacks in bcryptjsRaise the round count to 13 and you will see more progress lines before the hash prints.jose 5 examples · usage and stats
Sign a JWT with joseChange the expiration to '15m' or add another custom claim and watch the decoded payload update.
Verify a JWT with joseChange the expected audience back to the right value in the second check and see it pass.
Generate keys and export a JWK with joseChange 'ES256' to 'PS256' in both places and see the exported JWK fields change.
Decode a JWT with josePaste a token from your own app into the jwt variable to see its header and claims.
Encrypt and decrypt a JWT with joseAdd more claims to the payload and see the encrypted token grow while its contents stay hidden.