pbkdf-subtle
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

pbkdf-subtle

Hash/Verify PBKDF2. Uses only crypto.subtle.

Usage

./hash.mjs my_secret_password

To check the Authorization header:

const TOKEN_HASH = 'djAxKFWLYXubAcE8y5FktPCwWQGGoKVaFpkJ2OUcLRnV56O68DFbWSODXoVkBZn19otVVSiP';

const [scheme, token] = (request.headers.get('Authorization') ?? ' ').split(' ');
if (scheme != 'token' || !(await verify(TOKEN_HASH, token))) return new Response('', { status: 401 });

Readme

Keywords

none

Package Sidebar

Install

npm i pbkdf-subtle

Weekly Downloads

59

Version

1.0.0

License

MIT

Unpacked Size

3.24 kB

Total Files

7

Last publish

Collaborators

  • barnabyshearer