Skip to content

👷 bcrypt API for Cloudflare Workers

License

Notifications You must be signed in to change notification settings

rwv/bcrypt-workers

Repository files navigation

bcrypt-workers

GitHub Actions Workflow Status Swagger Validator

Deploy to Cloudflare Workers

This is a Cloudflare Workers project that provides a simple API to hash and compare passwords using bcrypt.

Usage

OpenAPI Documentation: https://bcrypt-workers.rwv.dev/

Hash a password

fetch("/hash", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    password: "password",
    rounds: 12,
  }),
})

Verify a password

fetch("/verify", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    password: "password",
    hash: "$2a$10$0AeRIW6lLG4Nz5uCLItonuasTNdScKoLzBX9hIzIII371CxBcwYrO",
  }),
})

Development

$ pnpm run dev

License

MIT