This is a Cloudflare Workers project that provides a simple API to hash and compare passwords using bcrypt.
OpenAPI Documentation: https://bcrypt-workers.rwv.dev/
fetch("/hash", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({
password: "password",
rounds: 12,
}),
})
fetch("/verify", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({
password: "password",
hash: "$2a$10$0AeRIW6lLG4Nz5uCLItonuasTNdScKoLzBX9hIzIII371CxBcwYrO",
}),
})
$ pnpm run dev
MIT