# worker-password-auth

> Password hashing and verifying for cloudflare workers using argon2

Latest version **1.0.0** (published 2023-07-30) · MIT OR Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install worker-password-auth
pnpm add worker-password-auth
yarn add worker-password-auth
bun add worker-password-auth
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2023-07-30 |
| First published | 2023-07-23 |
| Weekly downloads | 0 |
| License | MIT OR Apache-2.0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 165.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Author | James Birtles |
| Maintainers | jamesbirtles |
| Keywords | argon2, argon2id, password, hashing, cloudflare, workers |

## Links

- npm: https://www.npmjs.com/package/worker-password-auth
- Repository: https://github.com/jamesbirtles/worker-password-auth
- Homepage: https://github.com/jamesbirtles/worker-password-auth#readme
- Issues: https://github.com/jamesbirtles/worker-password-auth/issues
- npm.io page: https://npm.io/package/worker-password-auth

## Alternatives

- [@gemini-wallet/core](https://npm.io/package/@gemini-wallet/core.md) — 515.6K weekly downloads
- [utility](https://npm.io/package/utility.md) — 416.6K weekly downloads
- [@primno/dpapi](https://npm.io/package/@primno/dpapi.md) — 7.2K weekly downloads
- [pi-readseek](https://npm.io/package/pi-readseek.md) — 3.7K weekly downloads
- [@emilia-protocol/verify](https://npm.io/package/@emilia-protocol/verify.md) — 1.1K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2023-07-30
- 0.3.6 — 2023-07-30
- 0.3.5 — 2023-07-30
- 0.3.4 — 2023-07-30
- 0.3.3 — 2023-07-30
- 0.3.2 — 2023-07-30
- 0.3.1 — 2023-07-30
- 0.3.0 — 2023-07-30
- 0.2.1 — 2023-07-30
- 0.2.0 — 2023-07-30
- 0.1.0 — 2023-07-23

## README

# Worker Password Auth

A simple wrapper around the Rust
[`password_auth`](https://docs.rs/password-auth/latest/password_auth/) crate to make it available
for use in JavaScript. This provides two simple methods to hash a password, and verify the hash
against a password. This package is intended to be used in serverless-like environments,
specifically Cloudflare workers.

## Usage

```js
import { hashPassword, verifyPassword } from "worker-password-auth";

const hash = await hashPassword("abc123");
assert((await verifyPassword("abc123", hash)) === true);
```

### Usage with Vite

This package imports the wasm file directly in web targets. This means in vite you may need to use
[`vite-plugin-wasm`](https://github.com/Menci/vite-plugin-wasm).

E.g.

```ts
import wasm from "vite-plugin-wasm";
import topLevelAwait from "vite-plugin-top-level-await";

export default {
    plugins: [wasm(), topLevelAwait()],
};
```

## License

Licensed under either of

-   Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)
-   MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)

at your option.

### Contribution

Unless you explicitly state otherwise, any contribution intentionally
submitted for inclusion in the work by you, as defined in the Apache-2.0
license, shall be dual licensed as above, without any additional terms or
conditions.

---
_Source: https://npm.io/package/worker-password-auth · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
